Max value in array

it is showing error in output?

No your code is correct. There is no problem in it.

then why it is showing error?

I don’t know. It gave correct answer for me. There must be some back end problem.
But don’t worry. Your code is correct. Try submitting it later.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.