Python sums + binary search
Intuition\n1. Create sums array of sorted\n2. Search index\n\n# Approach\nBinary search of each index with time complexity O(logN)\n\n# Complexity\n- Time compl
# Intuition\n1. Create sums array of sorted\n2. Search index\n\n# Approach\nBinary search of each index with time complexity $$O(logN)$$\n\n# Complexity\n- Time complexity:\n  $$O(M*logN)$$\n\n- Space complexity:\n  $$O(Nbi)$$\n\n# Code\n```\nclass Solution:\n  def answerQueries(self, nums: List[int], queries: List[int]) -> List[int]:\n    nums, sums, res, n = sorted(nums), [0], [], len(nums)+1\n    for num in nums:\n      sums.append(sums[-1] + num)\n    \n    def bSearch(q, l=0, mid=n>>1, r=n):\n      while l < mid < r:\n        if sums[mid] > q:\n          r = mid\n        elif sums[mid] < q:\n          l = mid\n        else: break\n        mid = (l+r)>>1\n      return mid\n\n    return [bSearch(q) for q in queries]\n```
['Binary Search', 'Python3']