Easy C++ Solution || Pre-Computation || Two Pointer || T.C- O(nlogn) || S.C- O(n)
\n\n# Complexity\n- Time complexity:O(nlogn)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:O(n)\n Add your space complexity here, e.g. O(n) 
\n\n# Complexity\n- Time complexity:O(nlogn)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int numSubseq(vector<int>& nums, int target) {\n        int ans=0;\n        int n=nums.size();\n        int mod=1e9+7;\n        sort(nums.begin(),nums.end());\n        int l=0,r=n-1;\n\n        //pre-computing the power\n        vector<int> power(n);\n        power[0]=1;\n        for(int i=1;i<n;++i)\n        {\n            power[i]=(power[i-1]*2)%mod;\n        }\n\n        while(l<=r)\n        {\n            if(nums[l]+nums[r]<=target)\n            {\n                int diff=r-l;\n                ans=ans%mod+(power[diff])%mod;\n                l++;\n            }\n            else r--;\n        }\n\n        return ans;\n    }\n};\n```
['Two Pointers', 'C++']