GCD of two numbers
Problem Statement
Intuition
Appraoch:
GCD (a,b) = GCd(a-b, b) = Gcd(a%b, b) where a>b
The moment we get one of zero we return other
Time Comp = O(logbase(phi){min(a,b)})
Links
Video Links
https://www.youtube.com/watch?v=1xNbjMdbjug&ab_channel=takeUforward
Approach 1:
Approach 2:
Approach 3:
Approach 4:
Similar Problems
Last updated