CODE NOT WORKING FOR SOME TESTCASES , problem: painter partition problem

Rewrite the code :

  1. there is no T in problem.
  2. don’t sort A[]
1 Like


sir,this is screenshot of problem , it has T in it and there are 6 testcases , if i run code simply first two test cases are passing .if i sort the array which i know is wrong according to the problem but then last two 5 and 6 testcases are passing , i had done my best but i am not able to figure out the error.

Alright, the problem appeared differently on hackerblocks, try this

1 Like

also take long long everywhere instead of int (for N,K,T as well)