C++
C++\nclass Solution {\npublic:\n    bool judgePoint24(vector<int>& nums) {\n        vector<double> a(nums.begin(), nums.end());\n        return dfs(a);\n    }\n
```C++\nclass Solution {\npublic:\n    bool judgePoint24(vector<int>& nums) {\n        vector<double> a(nums.begin(), nums.end());\n        return dfs(a);\n    }\n    vector<double> get(int i, int j, double c, vector<double>& nums) {\n        vector<double> res;\n        for (int k = 0; k < nums.size(); k ++) {\n            if (k != i && k != j) {\n                res.push_back(nums[k]);\n            }\n        }\n        res.push_back(c);\n        return res;\n    }\n    bool dfs(vector<double> nums) {\n        if (nums.size() == 1) return fabs(nums[0] - 24) <= 1e-8;\n        for (int i = 0; i < nums.size(); i ++)\n            for (int j = 0; j < nums.size(); j ++) {\n                if (i != j) {\n                    double a = nums[i], b = nums[j];\n                    if (dfs(get(i, j, a + b, nums))) return true;\n                    if (dfs(get(i, j, a - b, nums))) return true;\n                    if (dfs(get(i, j, a * b, nums))) return true;\n                    if (b && dfs(get(i, j, a / b, nums))) return true;\n                }\n            }\n        return false;\n    }\n};\n```
[]