Painters code doubt

few test cases not passing

you can’t write s=a[n-1]
as array is not sorted
you have to take max element of array

Modified Code

i hope this help
if you have more doubts regarding this feel free to ask

if your doubt is resolved mark it as resolved from your doubt section inside your course