• + 0 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);
            
        }