Java Very Clean solution faster than 100% speed and space using Two Pointer O(nlogn) time
\nclass Solution {\n    private static final int MOD = 1000000007;\n    public int numSubseq(int[] nums, int target) {\n        long[] modPow = new long[nums.le
```\nclass Solution {\n    private static final int MOD = 1000000007;\n    public int numSubseq(int[] nums, int target) {\n        long[] modPow = new long[nums.length + 1];\n        modPow[0] = 1;\n        for (int i = 1; i < modPow.length; i++) {\n            modPow[i] = 2 * modPow[i-1] % MOD;\n        }\n        \n        Arrays.sort(nums);\n        int low = 0;\n        int high = nums.length -1;\n        long result = 0;\n        while (low <= high) {\n            if (nums[low] + nums[high] > target) {\n                high--;\n            } else {\n                long curPower = modPow[high-low];\n                result += curPower%MOD;\n                low++;\n            }\n        }\n        result = result%MOD;\n        return (int) result;\n    }\n}\n```
[]