Python
handles big numbers for you. [1]
Although, as you say that you are getting the answer “immediately”, your algorithm in python
is not probably the same as the one you used in C
.
@bruno‘s answer already explains why you are not getting the expected results in C.
CLICK HERE to find out more related problems solutions.