6 lines scala recursion. three pointers, two sliding windows
scala []\nobject Solution {\n  def maximizeWin(prizePositions: Array[Int], _k: Int): Int =\n    def f(i:Int,j:Int,k:Int,mx0:Int, mx:Int): Int =\n      if(k>= pr
```scala []\nobject Solution {\n  def maximizeWin(prizePositions: Array[Int], _k: Int): Int =\n    def f(i:Int,j:Int,k:Int,mx0:Int, mx:Int): Int =\n      if(k>= prizePositions.length) mx \n      else if(prizePositions(k)-prizePositions(j) <= _k) f(i,j,k+1,mx0,mx max (k-j+1 + mx0))\n      else if(prizePositions(j)-prizePositions(i) <= _k) f(i,j+1,k,mx0 max (j-i+1),mx)\n      else f(i+1,j,k,mx0,mx)\n    f(0,0,0,0,0)\n}\n\n```
['Scala']