import scala.collection.MapView
import scala.math.pow

implicit class Pairs[A, B]( p:List[(A, B)]) {
  def collectPairs: MapView[A, List[B]] = p.groupBy(_._1).view.mapValues(_.map(_._2)).filterNot(_._2.size<2)
}