Painter's Partition Problem

What’s the problem in this code?

hello @anshgoel_02

dont sort the array as painter can only paint contiguous blocks.
also becuase array will not be sorted u need to find the max explicitly using loop