Skip to content

Instantly share code, notes, and snippets.

View hell0-world's full-sized avatar

hyojoon shin hell0-world

View GitHub Profile
@hell0-world
hell0-world / algorithms.js
Last active September 9, 2021 10:59
Basic algorithms in JS
// GCD
// Euclidean algorithm
const gcd = (a,b) => {
if(!b) return a;
return gcd(b, a%b);
}
// LCM
// USING GCD
const lcm = (a,b) =>{