Swift solution
The code below is a simple implementation of the solution provided to the problem with the following stats:\n\n> Runtime: 220 ms, faster than 10.53% of Swift on
The code below is a simple implementation of the solution provided to the problem with the following stats:\n\n> Runtime: 220 ms, faster than 10.53% of Swift online submissions for 24 Game.\nMemory Usage: 21.1 MB, less than 100.00% of Swift online submissions for 24 Game.\n\nI wonder how could I make it faster and what are those 90% of Swift solutions which beat mine.\n\n```\nclass Solution {\n    let precision = 1e-3\n    let seeked = 24.0\n    \n    func judgePoint24(_ nums: [Int]) -> Bool {\n        return judgePoint24(nums.map({ Double($0) }))\n    }\n    \n    func judgePoint24(_ nums: [Double]) -> Bool {\n        if nums.count == 1 {\n            return nums[0] >= seeked - precision && nums[0] <= seeked + precision\n        }\n        for i in 0..<nums.count {\n            for j in 0..<nums.count {\n                if i == j {\n                    continue\n                }\n                var nums_ = nums.enumerated().filter({ $0.0 != i && $0.0 != j }).map({ $0.1 })\n                let parts = possibleParts(a: nums[i], b: nums[j])\n                for p in parts {\n                    nums_.append(p)\n                    if judgePoint24(nums_) {\n                        return true\n                    }\n                    nums_ = nums_.dropLast()\n                }\n            }\n        }\n        return false\n    }\n    \n    private func possibleParts(a: Double, b: Double) -> [Double] {\n        var res = [a + b, a - b, a * b]\n        if a != 0 {\n            res.append(b / a)\n        }\n        return res\n    }\n}\n```
['Swift']