Python short and clean. Functional programming.
Approach\nTL;DR, Similar to the Editorial solution, but written as a 1-liner.\n\n# Complexity\n- Time complexity: O(n * log(n))\n\n- Space complexity: O(n)\n\nw
# Approach\nTL;DR, Similar to the [Editorial solution](https://leetcode.com/problems/number-of-subsequences-that-satisfy-the-given-sum-condition/editorial/), but written as a 1-liner.\n\n# Complexity\n- Time complexity: $$O(n * log(n))$$\n\n- Space complexity: $$O(n)$$\n\nwhere, `n is length of nums`.\n\n# Code\n```python\nclass Solution:\n    def numSubseq(self, nums: list[int], target: int) -> int:\n        s_nums = sorted(nums)\n        return sum(\n            pow(2, bisect.bisect(s_nums, y, i) - 1 - i, 1_000_000_007)\n            for i, x in enumerate(s_nums)\n            if (y := target - x) >= x\n        ) % 1_000_000_007\n\n\n```
['Two Pointers', 'Binary Search', 'Sorting', 'Python', 'Python3']