GCD Hint GCD Hint GCD Hint

i don’t understand BIg GCD implementation

Title is too short (minimum is 15 characters)

Hey @namanitsofficial
let’s say the first number a is in the range 10^7 and the second number b is very large (in the range 10^250) So, we can see that first number ‘a’ can be handled by long long int data type but second number ‘b’ can not be handled by any int data type. Here we read second number as a string and we will try to make it less than and equal to ‘a’ by taking it’s modulo with ‘a’.

I highly suggest you to try run this code yourself on paper by taking some example.

In case of any doubt feel free to ask :slight_smile:
Mark your doubt as RESOLVED if you got the answer