scala oneliner
scala []\nobject Solution {\n  import scala.util.chaining._\n  def maxFrequency(nums: Array[Int], k: Int, numOperations: Int): Int =\n    nums.iterator.map(_.to
```scala []\nobject Solution {\n  import scala.util.chaining._\n  def maxFrequency(nums: Array[Int], k: Int, numOperations: Int): Int =\n    nums.iterator.map(_.toLong << 1).to(Vector).sorted.pipe{ns =>\n    ns.iterator.zipWithIndex.map{case (num,i) =>\n      List(-2*k-1,-1,1,2*k+1,4*k+1).map(x => ns.search(num + x).insertionPoint-i)\n    }.collect{ case List(a,b,c,d,e) => \n      ((c-b) + ((b-a + d-c) min numOperations)) max (e min numOperations)\n    }.max}\n}\n```
['Binary Search', 'Sorting', 'Scala']