lluque

AoC day 6

Dec 27th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.32 KB | None | 0 0
  1. import scala.io.Source
  2.  
  3. object day6 extends App {
  4.  
  5.   val input = Source.fromFile("day6.txt").getLines.toList
  6.   println((input.transpose map (x => x.groupBy(identity).mapValues(_.size).maxBy(_._2)._1)).mkString)
  7.   println((input.transpose map (x => x.groupBy(identity).mapValues(_.size).minBy(_._2)._1)).mkString)
  8.  
  9. }
Advertisement
Add Comment
Please, Sign In to add comment