Fix grammar.

This commit is contained in:
EliteDaMyth
2021-02-05 17:59:38 +05:30
committed by GitHub
parent ce7e7e2954
commit fdda80fc6b

View File

@ -11,9 +11,9 @@
const gcdOfTwoNumbers = (x, y) => { const gcdOfTwoNumbers = (x, y) => {
// x is smaller than y // x is smaller than y
// let gcd of x and y is gcdXY // let gcd of x and y is gcdXY
// so it devides x and y completely // so it divides x and y completely
// so gcdXY should also devides y%x (y = gcdXY*a and x = gcdXY*b and y%x = y - x*k so y%x = gcdXY(a - b*k)) // so gcdXY should also divide y%x (y = gcdXY*a and x = gcdXY*b and y%x = y - x*k so y%x = gcdXY(a - b*k))
// and gcd(x,y) is equals to gcd(y%x , x) // and gcd(x,y) is equal to gcd(y%x , x)
return x === 0 ? y : gcdOfTwoNumbers(y % x, x) return x === 0 ? y : gcdOfTwoNumbers(y % x, x)
} }