I have attached the link to the code in the comments.
1 test case is coming out to be wrong. Can anyone explain the problem?
change your max value from 0 to arr[0], and then compare the other values,
This is the corrected code
1 Like