public class Solution {
    public List> subsets(int[] S) {
           List> result=new ArrayList>();
           Arrays.sort(S);
           int N=S.length;
           int Max=1< subset=new ArrayList(); 
               int j=i;
               int idx=0;
               while(j>0){
                   if((j&1)!=0){
                      subset.add(S[idx]) ;
                   }
                   j=j>>1;
                 idx++;
               }
               result.add(subset);
              
           }
           return result;
        }
}