Binary Search + DP
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(nlogn)$$\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$O(n)$$\n# Code\n```python3 []\nclass Solution:\n    def maximizeWin(self, prizePositions: List[int], k: int) -> int:\n        n = len(prizePositions)\n        maxes = [0] * n\n        maxes[n-1] = 1\n        ans = 1\n        for i in range(n-2, -1, -1):\n            end = prizePositions[i] + k\n            lo, hi = i, n\n            idx = i\n            while lo + 1 < hi:\n                mid = lo + ((hi - lo)//2)\n                if prizePositions[mid] > end:\n                    hi = mid\n                else:\n                    lo = idx = mid\n            prizes = idx - i + 1\n            maxes[i] = max(maxes[i+1] if i+1 < n else 0, prizes)\n            ans = max(ans, prizes + (maxes[idx+1] if idx+1 < n else 0))\n        return ans\n\n```
['Binary Search', 'Dynamic Programming', 'Python3']