You are viewing a single comment's thread. Return to all comments →
my solution is
public static int restaurant(int l, int b) { return (l * b) / (int) Math.pow(findGcd(l, b), 2); }
private static double findGcd(int l, int b) { BigInteger gcd = BigInteger.valueOf(l).gcd(BigInteger.valueOf(b)); System.out.println(gcd); return gcd.doubleValue(); }
Seems like cookies are disabled on this browser, please enable them to open this website
Restaurant
You are viewing a single comment's thread. Return to all comments →
my solution is
public static int restaurant(int l, int b) { return (l * b) / (int) Math.pow(findGcd(l, b), 2); }