java recursive solution
Repeatedly select 2 numbers (all combinations) and compute, until there is only one number, check if it's 24.\n\nclass Solution {\n    public boolean judgePoint
Repeatedly select 2 numbers (all combinations) and compute, until there is only one number, check if it's 24.\n```\nclass Solution {\n    public boolean judgePoint24(int[] nums) {\n        return f(new double[] {nums[0], nums[1], nums[2], nums[3]});\n    }\n    \n    private boolean f(double[] a) {\n        if (a.length == 1) {\n            return a[0] == 24;\n        }\n        for (int i = 0; i < a.length; i++) {\n            for (int j = i + 1; j < a.length; j++) {\n                double[] b = new double[a.length - 1];\n                for (int k = 0, l = 0; k < a.length; k++) {\n                    if (k != i && k != j) {\n                        b[l++] = a[k];\n                    }\n                }\n                for (double k : compute(a[i], a[j])) {\n                    b[a.length - 2] = k;\n                    if (f(b)) {\n                        return true;\n                    }\n                }\n            }\n        }\n        return false;\n    }\n    \n    private double[] compute(double a, double b) {\n        return new double[] {a + b, a - b, b - a, a * b, a / b, b / a};\n    }\n}\n```
[]