bitmask||O(nlogn)||cpp
Intuition\n Describe your first thoughts on how to solve this problem. \ngenerate all the possible subset and then check whether ele-k is present in the subset 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\ngenerate all the possible subset and then check whether ele-k is present in the subset we pick..we can simply check it in o(1) by taking a array which will store the index of all the element .\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:O(nlogn)\n- Space complexity:O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int beautifulSubsets(vector<int>& nums, int k) {\n        int n=nums.size();\n         long long int maxi=(1ll<<n);\n        int cnt=0;\n        sort(nums.begin(),nums.end());\n        int ele[2001];\n        memset(ele,-1,sizeof(ele));\n        for(int i=0;i<n;i++)\n        {\n            ele[nums[i]]=i;\n        }\n        for( long long int  i=1;i<maxi;i++)\n        {\n            \n            bool f=true;\n             for(int j=0;j<n;j++)\n             {\n                  long long int  val=((1ll<<j)&i);\n                 if(val)\n                 {\n                      if(nums[j]<=k)continue;\n                      int req=(nums[j]-k);\n                     if(ele[req]==-1)continue;\n                     int idx=ele[req];\n                     long long int val2=(i&(1ll<<idx));\n                     if(val2){\n                         f=false;\n                         break;\n                     }\n                     \n                 }\n             }\n            \n            if(f)cnt++;\n           \n            \n            \n        }\n        return cnt;\n    }\n};\n```
['C++']