My code is not working for all the test cases. May I know the mistake.
Painter's partition problem
u cannot sort the array in the question its given that painters need to paint contigious segments of the board
also s will no longer be board[n-1]
instead make it
s = 0
for(int x : board) s = max(s , x);
ohh sorry. got my mistake. Thank you!!
1 Like