only one test case is passing by my code for this problem
Painter Problem
hello @dhruvprashar
a) dont sort the board because painter can only paint contigous blocks
search space s=max in array * t
e= summation *t
b) use long long to avoid overflow
u have not intiialised ur ans correctly.
it should be ans=e;
still getting only 4 cases cleared
![]()
here k should be t ,
and t should be k.
ur updated code
thank you very much:)