We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
There is really an issue here which has already been brought up in the comments in various forms. The word 'partition' is not used in the mathematical sense in the problem statement. I was trying to run over all subsets of the given array giving me the correct sum, which gave me a timeout almost all the time. Finally the comments brought me onto the right track.
Maybe ask for a splitting of the array into two contigous subarrays instead?
Nikita and the Game
You are viewing a single comment's thread. Return to all comments →
There is really an issue here which has already been brought up in the comments in various forms. The word 'partition' is not used in the mathematical sense in the problem statement. I was trying to run over all subsets of the given array giving me the correct sum, which gave me a timeout almost all the time. Finally the comments brought me onto the right track.
Maybe ask for a splitting of the array into two contigous subarrays instead?