Doubt in nigGCD

some test case are failing , please help me spot my mistake, below is the link of my code

Hello @mehul.narendra.dubey, you have done this in too much complicated manner. Although this much wasn’t required you just need to find the remainder from the integer no. and then take the gcd of those nos. And in one case you are getting runtime error. Consider the case when n = 0. I think you understand that. In case if you feel any confusion feel free to ask.

And there is no need of that power function as well.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.