Doubt about prefix ones question from starters 75

I tried solving the question prefix ones from starters 75 and after solving it passes 8 test cases and failed just 1 of them can anyone please help me to find what was wrong in the code
Solution: 87013090 | CodeChef
above is the link to it.
Thank you for your help.

1 Like

Your program will not work correctly in the case where the input string is of the form 1…10. In this case it attempts to find the maximum of an empty sequence in line 44.

thank you so much