Problem Link: http://www.spoj.com/problems/WTK/
Here are two of my submissions to this problem.
Code 1:
Removed
Code 2:
Removed
Both the codes are same except the function calling, but to my surprise, one got AC with a time around 1.7s while the other around 0.9s!
I don't understand what made so much difference.
Can anyone tell me why?
Thanks in advance.
Edit:
Same thing for the other Josephus problem Musical Chairs.
Problem Link: http://www.spoj.com/problems/ANARC08H/
Calling a function is reducing time by two!