Solution
The solution is based on the formula for the least common multiple of two numbers, and , below.
Code
Here is an implementation of the challenge. Click the “Run” button to observe the output.
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.