Painters problem

compiling problem and I think my logic is correct from my side can u plz check it

Can you send me your code

I have shared a link of my code can u plz check my code

plzz reply fast n solve my doubt

@ajayrajsingh_817 try long long instead of int. You are sorting the values are which is not allowed as it would change the order of elements.

so my logic is correct or not??? if not correct me sir

@ajayrajsingh_817 The fact that you are sorting the array makes your logic wrong. You Cannot sort the array.


can you plzz check my code it passes only 2 cases