Painter problem

I am receiving proper outputs but its showing wrong answer every time I submit it please check my codehttps://ide.codingblocks.com/s/250076

hello @Vansh1410
a) dont sort the array because painter are allowed to paint only continous block.
b) use long long datatype in place of int to avoid overlap
c) ur search space should be s=max element in array.
e=sum of array.

incorporate these changes in ur code and then it will work.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.