Practice · 2 of 3
mathlib: GCD & LCM
CHALLENGE
Difficulty: beginner+25 XP
Implement public int gcd(int a, int b) (Euclid, inputs > 0) and public long lcm(int a, int b) (a*b/gcd), backed by static validation you choose.
Press Submit to check your solution.
Back to lesson: Practice: Library Building