FASTER THAN 100% TIME +100% SPACE
JAVA CODE IS:\n# \n\nclass Solution {\n    public int numSubseq(int[] nums, int target) {\n      Arrays.sort(nums);\n        int res=0,mod=1000_000_000+7;\n    
JAVA CODE IS:\n# \n```\nclass Solution {\n    public int numSubseq(int[] nums, int target) {\n      Arrays.sort(nums);\n        int res=0,mod=1000_000_000+7;\n        int pow[]=new int[nums.length+1];\n        pow[0]=1;\n        for(int i=1;i<=nums.length;i++)\n            pow[i]=(pow[i-1]*2)%mod;\n      int i=0,j=nums.length-1;\n        while(i<=j){\n            if(nums[i]+nums[j]<=target) res=(res+pow[j-i++])%mod;\n            else j--;\n        }\n        return res;\n    }\n}\n```\nTIME : O(nlogn)\nSPACE : O(n)\n***PLEASE,UPVOTE IF THIS IS HELPFUL***
[]