You are viewing a single comment's thread. Return to all comments →
My code in Java 15:
public static int restaurant(int l, int b) { // Write your code here int oriSize = l * b; int pS = gcd(l, b); // possibleBiggestSide return (l / pS) * (b / pS); } private static int gcd(int a, int b){ if(a < b){ int temp = a; a = b; b = temp; } if(b == 0) return a; return gcd(b, a % b); }
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 code in Java 15: