MAXNUM3 Implementation Problem

Here is the link to my code : CompleteMediumvioletredBrocketdeer - Replit

I am not getting any case where this code will fail. Please help me find the case.

TIA!

Hey @kaneki13

Your code fails at this test case.

I just added a cout line in your code to show you the value you are getting after converting the input to long. According to the question, the number of digits can be 10^5, but if you are converting it to long, then there will be an integer overflow condition for values on n>18.

1 Like

Thanks alot! At first i thought it was the given input which was less than 10^5, now when i rechecked it’s number of digit, my bad!