Painters partition problem

not passing test cases…its correct only in my opinion then also

hello @hg11110000
a) use long long in place of int to avoid overflow.

b) dont sort the array because order matters .
c) search space l= max element of array (becuase array in not sorted ,it can be anywhere in the array)

r=summation of array