1 solutions
-
1thakuremon LV 4 @ 2024-04-01 20:42:09
We know that for any number N we can check all the divisors of N in sqrt(N) complexity. Basically we just need to go through all the divisors of N or M and check if it divides both N and M. we will take the minimum of such divisors except 1.
time complexity O(sqrt(N))
- 1
Information
- ID
- 1011
- Difficulty
- 7
- Category
- Math | Basic_Math Click to Show
- Tags
- (None)
- # Submissions
- 200
- Accepted
- 36
- Accepted Ratio
- 18%
- Uploaded By