Beginner Friendly || Clean Code || C++
\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# 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 n=nums.size(),mod = 1000000007;\n        int l=0,r=n-1,ans=0;\n        vector<int> power(n,1);\n        for(int i=1;i<n;i++) {\n            power[i] = (power[i-1]<<1) % mod;\n        }\n        sort(nums.begin(),nums.end());\n        while(l<=r) {\n            if(nums[l]+nums[r] > target) {\n                r--;\n            }\n            else {\n                ans = (ans+power[r-l++]) % mod;\n            }\n        }\n        return ans;\n    }\n};\n\n\n\n\n```
['Array', 'Two Pointers', 'Binary Search', 'Sorting', 'C++']