C++, Concise code with only one helper function
\nclass Solution {\n    vector<double> combine2(double a, double b) {\n        return {a / b, b / a, a + b, a - b, b - a, a * b};\n    }\n    static constexpr d
```\nclass Solution {\n    vector<double> combine2(double a, double b) {\n        return {a / b, b / a, a + b, a - b, b - a, a * b};\n    }\n    static constexpr double eps = 1e-4;\npublic:\n    bool judgePoint24(vector<int>& nums) {\n        vector<int> id ({0, 1, 2, 3});\n        do {\n            int a = nums[id[0]], b = nums[id[1]], c = nums[id[2]], d = nums[id[3]];\n            for (auto x: combine2(a, b))\n                for (auto y: combine2(c, d))\n                    for (auto z: combine2(x, y)) \n                        if (abs(z - 24) < eps) return true;\n            for (auto x: combine2(a, b))\n                for (auto y: combine2(c, x))\n                    for (auto z: combine2(d, y))\n                        if (abs(z - 24) < eps) return true;\n        } while (next_permutation(id.begin(), id.end()));\n        return false;\n    }\n};\n```
[]