C++ solution, Short, Easy to understand
\nclass Solution {\npublic:\n    bool f(vector<double> &s){\n        if(s.size() == 1) return abs(s[0]-24)<pow(10, -2);\n        for(int i=0; i<s.size()-1; i++)
```\nclass Solution {\npublic:\n    bool f(vector<double> &s){\n        if(s.size() == 1) return abs(s[0]-24)<pow(10, -2);\n        for(int i=0; i<s.size()-1; i++)\n        {\n            for(int j=0; j<4; j++)\n            {\n                double a;\n                if(j==0) a = s[i]+s[i+1];\n                else if(j==1) a = s[i]-s[i+1];\n                else if(j==2) a = s[i]*s[i+1];\n                else a = s[i]/s[i+1];\n                vector<double> t;\n                for(int k=0; k<s.size(); k++)\n                {\n                    if(k!=i && k!=i+1) t.push_back(s[k]);\n                    else if(k==i) t.push_back(a);\n                }\n                if(f(t)) return true;\n            }\n        }\n        return false;\n    }\n\n    bool pmt(vector<double> &s, vector<double> &num, int pos, int set){\n        if(pos==4) return f(num);\n        for(int i=0; i<4; i++)\n        {\n            if(set&(1<<i)) continue;\n            num[pos] = s[i];\n            if(pmt(s, num, pos+1, set|(1<<i))) return true;\n        }\n        return false;\n    }\n\n    bool judgePoint24(vector<int>& cards) {\n        vector<double> s(4), num(4);\n        for(int i=0; i<4; i++) s[i] = cards[i];\n        return pmt(s, num, 0, 0);\n    }\n};\n```
['Depth-First Search', 'C++']