Suppose I have a Map like
val x = Map(1 -> List("a", "b"), 2 -> List("a"), 3 -> List("a", "b"), 4 -> List("a"), 5 -> List("c")) How would I create from this a new Map where the keys are Lists of keys from x having the same value, e.g., how can I implement
def someFunction(m: Map[Int, List[String]]): Map[List[Int], List[String]] = // stuff that would turn x into // Map(List(1, 3) -> List("a", "b"), List(2, 4) -> List("a"), List(5) -> List("c")) ?