Sunday, 4 June 2023

LCM optimized

 Optimized solution to find LCM

We can use the formula :
A * B = GCD(A,B) * LCM(A,B)
(simple pair hai ye....)
As,
LCM(A,B) = (A*B) / GCD(A,B)

What is GCD?
=>  Here

Code :



No comments:

Post a Comment

Count of digits in factorial

 To count the digits in a factorial we must seek some optimization as you might also understand that getting all the product and storing the...