Geeksforgeeks

X

DAYS

:

HOUR

:

MINS

:

SEC

Error

Copied to Clipboard

Given a number **n** the task is to find the minimum number which is divisible by all numbers from 1 to n. Print the answer modulo (10^{9}+7).

**Example 1:**

Input:n =3Output:6Explanation:When n = 3 then the minimum number that is divisible by all the number till 3 is 6.

**Example 2:**

Input:n =4Output:12Explanation:When n = 4 then the minimum number that is divisible by all the number till 4 is 12.

**Your Task:**

You don't need to read input or print anything. Your task is to complete the function **numGame()** which takes an Integer n as input and returns the answer.

**Expected Time Complexity:** O(n*log(n))

**Expected Auxiliary Space:** O(1)

**Constraints:**

1 <= n <= 10^{5}

We are replacing the old Disqus forum with the new Discussions section given below.

Click here to view old Disqus comments.

Click here to view old Disqus comments.

Login to report an issue on this page.

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

YesLoading...

Number Game

...