MeetCode
Home
Doubts
Why is my C function not returning the …
Solved
1
49
Ask Doubt
View All Doubts
Solvers Leaderboard
Tutorials
Quiz
All Tests
Leaderboard
My Tasks
User Login
Dark
Enable Notifications
Toggle navigation
LCM Of Two Numbers
Computer Mathematics
Easy
2 views
Back to Questions
View Answer
0
Previous
GCD Of Two Numbers
Easy
P
Next
GCD Of Array
Medium
N
Problem Description
Compute lcm(a,b).
Input Format
Two integers a b.
Output Format
One integer lcm.
Sample Test Case
Input:
6 15
Output:
30
Constraints
a,b != 0
Official Solution
Compute g=gcd(a,b). lcm = abs(a/g*b) to avoid overflow if possible.
Please
login
to submit solutions and comments.
Solutions (0)
No solutions submitted yet. Be the first!
Discussion (0)
No comments yet. Start the discussion!
Prev
Next
Fullscreen Editor
0 lines • 0 chars
Esc close • Tab indent
No comments yet. Start the discussion!