a few solutions
Try every permutation of the input array A with every precedent of operators +, -, *, / for adjacent array values, initially a,b,c,d recursively reduced to a,b,
Try every permutation of the input array `A` with every precedent of operators `+`, `-`, `*`, `/` for adjacent array values, initially `a`,`b`,`c`,`d` recursively reduced to `a`,`b`,`c` recursively reduced to `a`,`b` with recusive base case `a` which we compare to a epilson value, ie. a small value to deterine floating-point equality for the target `T = 24.0`.\n\n---\n\n*Javascript*\n```\nlet judgePoint24 = (A, N = 4, T = 24.0, EPS = 0.0001) => {\n    let perms = [];\n    let f = (i = 0) => {\n        if (i == N) {\n            perms.push([...A]);\n            return;\n        }\n        for (let k = i; k < N; ++k) {\n            [A[i], A[k]] = [A[k], A[i]];\n            f(i + 1);\n            [A[i], A[k]] = [A[k], A[i]];\n        }\n    };\n    f();\n    let go = (a, b, c, d) =>\n        a && b && c && d ?\n            go(a + b, c, d) || go(a - b, c, d) || go(a * b, c, d) || (b && go(a / b, c, d)) ||\n            go(a, b + c, d) || go(a, b - c, d) || go(a, b * c, d) || (c && go(a, b / c, d)) ||\n            go(a, b, c + d) || go(a, b, c - d) || go(a, b, c * d) || (d && go(a, b, c / d)) :\n        a && b && c ?\n            go(a + b, c) || go(a - b, c) || go(a * b, c) || (b && go(a / b, c)) ||\n            go(a, b + c) || go(a, b - c) || go(a, b * c) || (c && go(a, b / c)) :\n        a && b ?\n            go(a + b) || go(a - b) || go(a * b) || (b && go(a / b))\n        : Math.abs(T - a) < EPS;\n    for (let x of perms)\n        if (go(...x))\n            return true;\n    return false;\n};\n```\n\n*C++*\n```\nclass Solution {\npublic:\n    using VI = vector<int>;\n    bool judgePoint24(VI& A) {\n        sort(A.begin(), A.end());\n        do {\n            if (go(A[0], A[1], A[2], A[3]))\n\t\t\t    return true;\n        } while (next_permutation(A.begin(), A.end()));\n        return false;\n    }\nprivate:\n    bool go(double a, double b, double c, double d) {\n        return\n            go(a + b, c, d) || go(a - b, c, d) || go(a * b, c, d) || (b && go(a / b, c, d)) ||\n            go(a, b + c, d) || go(a, b - c, d) || go(a, b * c, d) || (c && go(a, b / c, d)) ||\n            go(a, b, c + d) || go(a, b, c - d) || go(a, b, c * d) || (d && go(a, b, c / d));\n    }\n    bool go(double a, double b, double c){\n        return\n            go(a + b, c) || go(a - b, c) || go(a * b, c) || (b && go(a / b, c)) ||\n            go(a, b + c) || go(a, b - c) || go(a, b * c) || (c && go(a, b / c));\n    }\n    bool go(double a, double b){\n        return go(a + b) || go(a - b) || go(a * b) || (b && go(a / b));\n    }\n\tbool go(double a) {\n\t    return abs(24 - a) < 0.0001; // epsilon\n\t}\n};\n```
[]