C++ DFS Solution easy-understanding
\nclass Solution {\n    vector<double> compute(double x, double y)\n    {\n        return {x + y, x - y, y - x, x * y, x / y, y / x};\n    }\n    \n    bool hel
```\nclass Solution {\n    vector<double> compute(double x, double y)\n    {\n        return {x + y, x - y, y - x, x * y, x / y, y / x};\n    }\n    \n    bool helper(vector<double> &v){\n        if(v.size()==1) return abs(v[0] - 24) < 0.0001;\n        \n        for(int i=0; i < v.size(); i++){\n            for(int j=i+1; j < v.size(); j++){\n                double n1 = v[i];\n                double n2= v[j];\n                vector<double> next;\n                \n                for(double &num: compute(n1,n2)){\n                    next.clear();\n                    next.push_back(num);\n                    for(int k=0; k < v.size(); k++){\n                        if(k!=i && k!=j) next.push_back(v[k]);\n                    }\n                    if(helper(next)) return true;\n                }\n            }\n        }\n        return false;\n    }\npublic:\n    bool judgePoint24(vector<int>& cards) {\n        vector<double> v(cards.begin(), cards.end());\n        return helper(v);\n    }\n};\n\n```
['Depth-First Search', 'C']