Problem with code


this is the code for the painter’s partition problem.
It passes for half of the test cases but not for the rest. Please check the problem with the code.

@amanb25
You cannot sort the array.
I have made the required changes, there were slight changes with the check function as well.

but isn’t binary search to be used only on sorted arrays?

@amanb25
We are not doing binary search on the array, but on the search space.
Have you seen all the videos provided in the course? If not I strongly suggest you to watch them.

1 Like