Problem Solution

1 solutions

  • 1
    @ 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
9
Category
Math | Basic_Math Click to Show
Tags
(None)
# Submissions
196
Accepted
12
Accepted Ratio
6%
Uploaded By