C++ clean and fast
\nclass Solution {\nvector<double> v;\nbool flag = false;\n\nvoid dfs(int n){\n    \n    if(n == 1){\n        if(abs(v[0] - 24) <= 0.0000001){\n            flag
```\nclass Solution {\nvector<double> v;\nbool flag = false;\n\nvoid dfs(int n){\n    \n    if(n == 1){\n        if(abs(v[0] - 24) <= 0.0000001){\n            flag = true;\n        }\n        return;\n    }\n    \n    for(int i = 0; i < n; ++i){\n        for(int j = i + 1; j < n; ++j){\n            double a = v[i];\n            double b = v[j];\n            \n            v[i] = a + b;\n            v[j] = v[n-1];\n            dfs(n-1);\n            \n            v[i] = a - b;\n            v[j] = v[n-1];\n            dfs(n-1);\n            \n            v[i] = b - a;\n            v[j] = v[n-1];\n            dfs(n-1);            \n\n            v[i] = a * b;\n            v[j] = v[n-1];\n            dfs(n-1);            \n\n            if(b != 0){\n                v[i] = a / b;\n                v[j] = v[n-1];\n                dfs(n-1);\n            }\n\n            if(a != 0){\n                v[i] = b / a;\n                v[j] = v[n-1];\n                dfs(n-1);\n            }\n            \n            v[i] = a;\n            v[j] = b;\n        }\n    }\n}    \n    \npublic:\n    bool judgePoint24(vector<int>& nums) {\n        v.resize(4, 0.0);\n        v[0] = (double) nums[0];\n        v[1] = (double) nums[1];\n        v[2] = (double) nums[2];\n        v[3] = (double) nums[3];\n        \n        dfs(4);\n        return flag;\n    }\n};\n```
[]