Return the max value of a List[Int]
if unique, otherwise return -1.
def maxIfUnique(li: List[Int]) = li.groupBy(_.intValue).maxBy(_._1)._2 match {
case x if x.size == 1 => x.head
case _ => -1
}
scala> val list = List(1, 2, 1) // 2 is max and is unique