LOSTMAX second test case

I seem to have a correct code for this question. I checked for all possible test cases, including numbers with more than one digit, but I am not able to get what this mysterious second test case is. Can some one help me with my code here which looks almost similar to this already solved code here. I don’t understand why the later code is correct and mine is not correct.
Thank you :slight_smile:

How did you arrive at conclusion that numbers with more than 1 digit are a corner case for your approach? :confused:
Cause they are not.

Its because I am told that second test case might fail if the input to the array is more than one digit. Which is, of course, not the corner case. Yeah, I agree with you that it doesn’t really help mentioning that point in the question, but it’s worth a sentence :stuck_out_tongue:

Try using getline for input and see if you get AC. I think its worth a try.

I too have a similar problem. What is wrong with my solution? I have tested a lot.This is my submission for LOSTMAX from LTIME50. Further clarifications on where I went wrong is appreciated. Thank You.

Here you go-

10 11 12 13 14 15 16 17 18 19 20

Your Output
36700100 (garbage value)

multiple digit numbers are a corner case for your approach

There, your code has got an AC now (re-check the link you posted here :slight_smile: )