The code in this video not working for sorted array only

its giving -1 but i think it should give the maximum element of the array.
is pivot meaningless for a sorted array???

@sirraghavgupta hey Raghav do you have any test case which gives -1 as output so that I can explain your doubt asap.

@sirraghavgupta I think shubh already replied to your doubt.