How InterviewBIt is getting this output from this input?


The input was A : “5121478262 8070067M75 X199R 547 8C0A11 93I630 4P4071 029W433619 M3 5 14703818 776366059B9O43393”
And the expected output was “2147483647”.
How?? How interviewbit how??


I think this is an error in the question, carried over from C or other languages. 2147483647 == 2**31 - 1 is supposed to represent MAX_INT, the maximum value an int can have. Python 2’s MAX_INT can be higher than the above, whereas Python 3 just doesn’t have a notion of MAX_INT.


the integer is overflowing so max value of integer is returned