Getting WA in LOSTMAX

,

Why did I get WA in [LOSTMAX][1]'s subtask 1 ?

This is my


[2] : [https://ideone.com/VQx3hp][3]


  [1]: https://www.codechef.com/problems/LOSTMAX
  [2]: https://ideone.com/VQx3hp
  [3]: https://ideone.com/VQx3hp
1 Like

Consider this TC:

   23 5 4 0 4  

Expected o/p: 23
Your code gives: 5
This is because max(a) finds the maximum among the strings not ints, since you have not typecast the inputs in a.
Hope this helps!

Thank you very much! I got AC.

1 Like

Please don’t reward points mate, it reduces your karma.