My doesnt pass all test cases why

hello @navin
a)
image
use <=

b) initialise s with maximum value present in array.

ohh thanks a lot …