https://ide.codingblocks.com/s/48317
whats wrong with my code?
Big gcd@ wrong ans
Heyy Ayush !!!
Actually this method won’t give you correct answer as you can see the input is greater than 10^18 so, you should take input as string and then for one input which is bigger try to build it and while building it take modulo with the input (smaller one) .
Take care of case with one value as 0 because you won’t be able to take modulo .
Take a look on this code , i have added some required computation in your code -->
https://ide.codingblocks.com/s/48391
1 Like