A lot of solutions,A lot of people are copying
I didn\'t have an idea at first\n Describe your first thoughts on how to solve this problem. \n\n# Use a backtracking method\n Describe your approach to solving
# I didn\'t have an idea at first\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Use a backtracking method\n<!-- Describe your approach to solving the problem. -->\n\n# Time:O(1) Space:O(n3)\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    boolean flag=false;\n    double decimal=1e-6;\n    List<Double> arr=new ArrayList<>();\n    public boolean judgePoint24(int[] cards) {\n        for(int num:cards) arr.add((double)num);\n        read(arr);\n        return flag;\n    }\n    private void read(List<Double> arr){\n        if(flag) return;\n        if(arr.size()==1 && Math.abs(arr.get(0)-24.0)<=decimal){\n            flag=true;\n            return;\n        }\n        for(int i=0;i<arr.size();i++){\n            for(int j=0;j<i;j++){\n                double p1=arr.get(i),p2=arr.get(j);\n                List<Double> list=new ArrayList<>();\n                list.addAll(Arrays.asList(p1+p2,p1-p2,p2-p1,p1*p2));\n                if(p1>decimal) list.add(p2/p1);\n                if(p2>decimal) list.add(p1/p2);\n                arr.remove(i);\n                arr.remove(j);\n                for(double num:list){\n                    arr.add(num);\n                    read(arr);\n                    arr.remove(num);\n                }\n                arr.add(j,p2);\n                arr.add(i,p1);\n            }\n        }\n    }\n}\n```
['Math', 'Java']