JavaScript (JS) solution 🔥🔥🔥 Ultrafast 💯💯💯
JavaScript solution\n\n\nvar numSubseq = function(nums, target) {\n    const MOD = 1000000007;\n\n    nums = nums.sort((a, b) => a - b);\n\n    const pows = [1]
JavaScript solution\n\n```\nvar numSubseq = function(nums, target) {\n    const MOD = 1000000007;\n\n    nums = nums.sort((a, b) => a - b);\n\n    const pows = [1];\n    \n    for (let i = 1; i < nums.length; i++) {\n        pows.push(pows[i - 1] * 2 % MOD);\n    }\n    \n    let left = 0;\n    let right = nums.length - 1;\n    let ans = 0;\n\n    while (left <= right) {\n        if (nums[left] + nums[right] > target) {\n            right--;\n        } else {\n            ans = (ans + pows[right - left]);\n            left++;\n        }\n    }\n\n    return ans % MOD;\n};\n```
['Two Pointers', 'Binary Search', 'Binary Tree', 'JavaScript']