scala oneliners, Map+SortedSet with debug output
```scala []
class TaskManager(_tasks: List[List[Int]]) {
  // _tasks list of [userId, taskId, priority]
  import collection.mutable
  import util.chaining.scalaUtilChainingOps
  var DEBUG = false
  //DEBUG = true
  def dump(s:String):Unit = if(DEBUG) println(s"$s\n  tMap=$tMap\n  pMap=$pMap")

  val tMap = mutable.Map.from(_tasks.map{l => l(1) -> (l(0),l(2))})
  val pMap = mutable.SortedSet.from(_tasks.map{l => (l(2),l(1),l(0))})

  def add(userId: Int, taskId: Int, priority: Int): Unit =
    (tMap += (taskId -> (userId, priority)))
      .tap(_ => pMap += ((priority, taskId, userId)))
      .tap(_ => dump(s"add($userId, $taskId, $priority)"))

  def edit(taskId: Int, newPriority: Int): Unit =
    tMap(taskId)
      .tap(_ => rmv(taskId))
      .tap((userId, _) => add(userId, taskId, newPriority))
      .tap(_ => dump(s"edit($taskId, $newPriority)"))

  def rmv(taskId: Int): Unit =
    tMap(taskId)
      .tap(_ => tMap -= taskId)
      .tap((userId, priority) => pMap -= ((priority, taskId, userId)))
      .tap(_ => dump(s"rmv($taskId)"))

  def execTop(): Int =
    pMap.lastOption
      .tap(_.foreach(x => rmv(x._2)))
      .map(_._3).getOrElse(-1)
      .tap(_ => dump(s"execTop()"))

  dump(s"ctor")
}

/**
 * Your TaskManager object will be instantiated and called as such:
 * val obj = new TaskManager(tasks)
 * obj.add(userId,taskId,priority)
 * obj.edit(taskId,newPriority)
 * obj.rmv(taskId)
 * val param_4 = obj.execTop()
 */
```
['Scala']