Both solution have only a single line difference in way of output.
I am not able to figure out why solution2 is wrong. Could anyone help? @ssjgz@galencolin@ssrivastava990
@ssjgz I found the error. Actually there was issues in problem test files where there might be chance of leading zeroes. I tested using assert and it gave runtime error.
Thanks:)