C++ solution (sorting + sliding window protocol)
\nCode:\nclass Solution {\npublic:\n    \n    int numSubseq(vector& nums, int target) {\n        \n        sort(nums.begin(), nums.end());\n        \n        in
\nCode:\nclass Solution {\npublic:\n    \n    int numSubseq(vector<int>& nums, int target) {\n        \n        sort(nums.begin(), nums.end());\n        \n        int l = 0;\n        int r = nums.size()-1;\n        int ans = 0;\n        long long por[nums.size()+1];\n        por[0]=1;\n\t\t\n\t\t/// Also, we can reduce the no.calculations for calculating power as well (I just didn\'t do it here)\n        for (int i=1; i<=nums.size(); i++) {\n            por[i] = (2*por[i-1])%1000000007;\n        }\n        while(l<=r) {\n            int sum = nums[l]+nums[r];\n            if (sum<=target) {\n                ans = ((ans + por[r-l])%1000000007);\n                l++;\n            } else {\n                r--;\n            }\n        }\n        return ans;\n    }\n};
[]