Python3 solution beats 95.78% 🚀🚀 || quibler7
\n\n\n# Code\n\nclass Solution:\n    def numSubseq(self, nums: List[int], target: int) -> int:\n        nums.sort()\n        l, r = 0, len(nums) - 1\n        re
![Screenshot 2023-05-06 at 7.46.44 AM.png](https://assets.leetcode.com/users/images/a1e02f9c-966f-499b-9f4e-010e975c5554_1683339438.5637286.png)\n\n\n# Code\n```\nclass Solution:\n    def numSubseq(self, nums: List[int], target: int) -> int:\n        nums.sort()\n        l, r = 0, len(nums) - 1\n        res = 0\n        mod = 10**9 + 7\n        while l <= r:\n            if nums[l] + nums[r] > target:\n                r -= 1\n            else:\n                res += pow(2, r - l, mod)\n                l += 1\n        return res % mod\n```
['Python3']