advent-of-code/2019/Scala/day08/codegolf_part1.sc

2 lines
206 B
Python
Raw Permalink Normal View History

2019-12-08 08:39:36 +01:00
print(((list:List[Int])=>list.count(_==1)*list.count(_==2))(Source.fromFile(getClass.getResource("/input8.txt").getFile).toList.map(_.asDigit).grouped(150).toList.map(x=>(x.count(_==0),x)).minBy(_._1)._2))