## DEV Community is a community of 891,187 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Durga Pokharel

Posted on

# Day 54 Of 100DaysOfCode: More About Algorithm

This is my day 54th of #100DaysOfcode and #python learning. Like yesterday today also continue to learn more about an algorithm. I studied greedy algorithm, implement and analyzed the greedy algorithm, efficient algorithm for grouping children and car fueling in Algorithmic Toolbox
Also learned more properties of SQL including selecting multiple columns from a table, select distinct, use of count, where and, etc From datacamp
Tried to write some efficient algorithm to calculate Fibonacci number, LCM, HCF as a homework assignment of Coursera.

# Algorithm to find LCM of two number

``````def compute_gcd(a,b):
while(b):
a, b = b , a % b
return a
def lcm(a,b):
lcm = (a*b)//compute_gcd(a,b)
return lcm

a,b = map(int,input().split())
print(lcm(a,b))
``````

Above code run fast and its outcome is,

``````714552 374513
170777928
``````

Day 54 Of #100DaysOfCode
* Learned more About SQL From Data Camp
* Tried to write Efficient Algorithm to Calculate LCM #WomenWhoCode #DEVCommunity #CodeNewbie pic.twitter.com/Ngme50mDSH

— Durga Pokharel (@mathdurga) February 20, 2021

## Discussion (2)

Otu Michael
``````def compute_gcd(a,b):
while(b):
a, b = b , a % b
return a
``````

You have written different versions of this function...

Durga Pokharel

thank you for the suggestion.