Gives WA on a few test cases

@priyamthakuria27 i cant understand your check() function, it is wrong.
Basically what you need to do is, do sum and check if(sum>mid) , if true then do painters-- and also assign sum = arr[i] because that arr[i] was not added in the sum so, take it.

Also initialize your start variable with maximum element of array not with arr[n-1] because the array is not sorted.