Solution Given seems Wrong


#1

The solution given here converts the string into long long int ‘k’ but if size of string is greater than 19 i.e more than 64 bit then how can k store that value. I debugged and printed the value of ‘k’ for a test case at which my other solution failed and found that the value of k is different from the input string. How come answer correct if the value of ‘k’ is different from the input string?
Please see the complete solution of this problem to understand my comment.