Ultra fast mathematicians problem

question link:
https://hack.codingblocks.com/contests/c/452/66

wrong ans in one case
no output in other

@Dhruv Kaushik
Try this http://ide.codingblocks.com/#/s/14984

1 Like

Firstly, you should use strings because you cannot store nos of 100 digits in int type. Take a look at this. It’s really simple. http://ide.codingblocks.com/#/s/14986

1 Like

The problem with your code is , you will not be able to take input when inputs have larger number of digits
Instead of this , there is some issue with your logic also . As you are taking inputs as integer , leading zeroes will get excluded , so you will get wrong answer for all inputs which have leading zeroes

Dry run your code with this test case
1010 0101

Hope you understood now ! :slight_smile: