Python DP
\nclass Solution:\n    def maximizeWin(self, prizePositions: List[int], k: int) -> int:\n\n        prefix = [0] * len(prizePositions)\n        sufix = [0] * len
```\nclass Solution:\n    def maximizeWin(self, prizePositions: List[int], k: int) -> int:\n\n        prefix = [0] * len(prizePositions)\n        sufix = [0] * len(prizePositions)\n        prefix[0] = 1\n        sufix[-1] = 1\n        left, right = 0, 1\n        while right < len(prizePositions):\n            if prizePositions[right] - prizePositions[left] <= k:\n                prefix[right] = max(prefix[right - 1], right - left + 1)\n                right += 1\n            else:\n                left += 1\n\n        left, right = len(prizePositions) - 2, len(prizePositions) - 1\n        while left >= 0:\n            if prizePositions[right] - prizePositions[left] <= k:\n                sufix[left] = max(sufix[left + 1], right - left + 1)\n                left -= 1\n            else:\n                right -= 1\n                \n        \n        ans = 0\n        print(prefix)\n        print(sufix)\n        for border in range(len(prizePositions) + 1):\n            p = prefix[border - 1] if border > 0 else 0\n            s = sufix[border] if border < len(prizePositions) else 0\n            l = p + s\n            ans = max(ans, l)\n            \n        return ans\n```
['Dynamic Programming', 'Python']