Least Common Multiple

EasyMath

Description

Given two positive integers a and b, return their least common multiple.

Examples

Input:a = 4, b = 6
Output:12
Explanation:

The smallest positive number that both 4 and 6 divide into is 12.

Input:a = 3, b = 5
Output:15
Explanation:

The smallest positive number that both 3 and 5 divide into is 15.

Input:a = 12, b = 8
Output:24
Explanation:

The smallest positive number that both 12 and 8 divide into is 24.

Constraints

  • 1 ≤ a, b ≤ 10⁴

Ready to solve this problem?

Practice solo and sharpen your skills for technical interviews.