You are viewing a single comment's thread. Return to all comments →
Scala solution without % :
def gcd(x: Int, y: Int): Int = { (x, y) match { case a if x == y => x case b if x > y => gcd(x - y, y) case c if x < y => gcd(x, y - x) } }
Seems like cookies are disabled on this browser, please enable them to open this website
Computing the GCD
You are viewing a single comment's thread. Return to all comments →
Scala solution without % :