2 pointers easy Python solution
\tnums.sort()\n\tn = len(nums)\n\ti, j = 0, n - 1\n\tresult = 0\n\twhile i <= j:\n\t\tif nums[i] + nums[j] <= target:\n\t\t\tresult += 2 ** (j - i)\n\t\t\ti += 
\tnums.sort()\n\tn = len(nums)\n\ti, j = 0, n - 1\n\tresult = 0\n\twhile i <= j:\n\t\tif nums[i] + nums[j] <= target:\n\t\t\tresult += 2 ** (j - i)\n\t\t\ti += 1\n\t\telse:\n\t\t\tj -= 1\n\treturn result % (10 ** 9 + 7)
[]