PYTHON | SIMPLE BINARY SEARCH | CLEAN CODE
```\nclass Solution:\n    def answerQueries(self, nums: List[int], queries: List[int]) -> List[int]:\n        def bin_sch(num):\n            lo = 0\n           
```\nclass Solution:\n    def answerQueries(self, nums: List[int], queries: List[int]) -> List[int]:\n        def bin_sch(num):\n            lo = 0\n            hi = len(prefix)-1\n            ans = 0\n            while lo <= hi:\n                mid = (lo+hi)//2\n                if prefix[mid] <= num:\n                    ans = mid\n                    lo = mid+1\n                else:\n                    hi = mid-1\n            return ans\n                    \n        nums.sort()\n        prefix = [0]\n        ans = []\n        for i in nums:\n            prefix += [prefix[-1]+i]\n        for q in queries:\n            ans += [bin_sch(q)]\n        return ans
['Python']