Python solution easy-understanding
class Solution:\n\n    # calculte the different results of two numbers\n    def two_number(a, b):\n        s = set()\n        s.add(a+b)\n        s.add(a-b)\n  
class Solution:\n\n    # calculte the different results of two numbers\n    def two_number(a, b):\n        s = set()\n        s.add(a+b)\n        s.add(a-b)\n        s.add(b-a)\n        s.add(a*b)\n        if b!=0:\n            ans = a/b\n            if abs(ans-round(ans))<10**(-3):\n                s.add(round(ans))\n            else:\n                s.add(a/b)\n        if a!=0:\n            ans = b/a\n            if abs(ans-round(ans))<10**(-3):\n                s.add(round(ans))\n            else:\n                s.add(b/a)\n        return s\n    \n    # calculte the different results of three numbers\n    def three_number(l1):\n        s = set()\n        for i in range(3):\n            rest = list(set(range(0,3))-set([i]))\n            s1 = Solution.two_number(l1[rest[0]], l1[rest[1]])\n            for x in s1:\n                s = s.union(Solution.two_number(l1[i], x))\n        return s\n\n    def judgePoint24(self, cards: List[int]) -> bool:\n        # 2-2\n        for i in range(1,4):\n            s1 = Solution.two_number(cards[0], cards[i])\n            rest = list(set(range(0,4))-set([0, i]))\n            s2 = Solution.two_number(cards[rest[0]], cards[rest[1]])\n            for x in s1:\n                for y in s2:\n                    if 24 in Solution.two_number(x, y):\n                        return True\n        #1-3\n        for i in range(4):\n            three = Solution.three_number(cards[:i]+cards[i+1:])\n            for x in three:\n                if 24 in Solution.two_number(x, cards[i]):\n                        return True\n        return False
['Python']