lcm static method

int lcm(
  1. int a,
  2. int b
)

Get least common multiple

a - First number b - Second number Returns LCM of the two numbers

Implementation

static int lcm(int a, int b) {
  return (a * b) ~/ gcd(a, b);
}