Simple subset finding Method - Java | Less lines of code
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\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    public int beautifulSubsets(int[] nums, int k) {\n        List<List<Integer>> outer = new ArrayList<>();\n        outer.add(new ArrayList<>()); // empty \n        int cnt = 0;\n        for(int num : nums){\n            int n = outer.size();\n            for(int i=0; i<n; i++){\n                List<Integer> internal = new ArrayList<>(outer.get(i));\n                internal.add(num);\n                if(!isBeautiful(internal, k)){\n                    outer.add(internal);\n                    cnt++;\n                }\n                \n            }\n        }\n        return cnt;\n    }\n    private boolean isBeautiful(List<Integer> internal, int k){\n        if(internal.size() == 1){\n            return false;\n        }\n        for(int i = 0; i<internal.size()-1; i++){\n            for(int j = i+1 ; j<internal.size(); j++){\n                if(Math.abs(internal.get(i) - internal.get(j)) == k){\n                    return true;\n                }\n            }\n        }\n        return false;\n    }\n}\n```
['Java']