Javascript and Python
Idea\n1. recursively try every pair of nums[i] and nums[j], with rest numbers from nums\n\nJavascript\njs\nvar judgePoint24 = function(nums) {\n    if (nums.len
**Idea**\n1. recursively try every pair of `nums[i]` and `nums[j]`, with rest numbers from `nums`\n\n**Javascript**\n```js\nvar judgePoint24 = function(nums) {\n    if (nums.length == 1) {\n        return Math.abs(nums[0] - 24) < 0.01;\n    }\n\n    let ans = false;\n    for (let i = 0; i < nums.length; ++i) {\n        for (let j = 0; j < i; ++j) {\n            // grab other numbers\n            const rest = [];\n            for (let k = 0; k < nums.length; ++k) {\n                if (k != i && k != j) {\n                    rest.push(nums[k]);\n                }\n            }\n            // list all possibilities\n            const target = [\n                nums[i] + nums[j], nums[i] - nums[j],\n                nums[j] - nums[i], nums[i] * nums[j]\n            ];\n            if (nums[i]) target.push(nums[j] / nums[i]);\n            if (nums[j]) target.push(nums[i] / nums[j]);\n            // try next round with less numbers\n            for (const t of target) {\n                ans = ans || judgePoint24([t, ...rest]);\n                if (ans) return true;\n            }\n        }\n    }\n    return ans;\n};\n```\n\n**Python**\n```python\ndef judgePoint24(self, nums):\n\tif len(nums) == 1:\n\t\treturn abs(nums[0] - 24) < 0.01\n\n\tans = False\n\tfor i in range(len(nums)):\n\t\tfor j in range(i):\n\t\t\trest = []\n\t\t\tfor k in range(len(nums)):\n\t\t\t\tif k != i and k != j:\n\t\t\t\t\trest.append(nums[k])\n\t\t\ttarget = [\n\t\t\t\tnums[i] + nums[j], nums[i] - nums[j],\n\t\t\t\tnums[j] - nums[i], nums[i] * nums[j]\n\t\t\t]\n\t\t\tif nums[i]:\n\t\t\t\ttarget.append(nums[j] / float(nums[i]))\n\t\t\tif nums[j]:\n\t\t\t\ttarget.append(nums[i] / float(nums[j]))\n\t\t\tfor t in target:\n\t\t\t\tans = ans or self.judgePoint24(rest[:] + [t])\n\t\t\t\tif ans:\n\t\t\t\t\treturn True\n\treturn ans\n```
['Python', 'JavaScript']