LCM of Two Numbers Problem

LCM of Two Numbers Problem — ExecCode School DSA Practice

Solve the LCM of Two Numbers problem on ExecCode. Free online school DSA practice in Math. Write and run code in Java, C++, Python — no signup required to run.

Problem description

You are given two whole numbers. Your task is to solve LCM of Two Numbers. Find the least common multiple (the smallest number that both divide into) and print it.

Examples

Input 4 6; Output 12. Input 2 3; Output 6

Constraints

1 <= A,B <= 10^6

Practice LCM of Two Numbers free on ExecCode. Browse DSA problems, topic map, and placement guides.