From 8cbe1a8f52098dc382e7dbcf9cd0592a4535ef1a Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Sat, 2 Dec 2023 12:07:15 +0100 Subject: [PATCH] simplified foreach loop --- src/day2/Puzzle2.scala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/day2/Puzzle2.scala b/src/day2/Puzzle2.scala index 1a90181..8ffdcb2 100644 --- a/src/day2/Puzzle2.scala +++ b/src/day2/Puzzle2.scala @@ -40,9 +40,7 @@ object Puzzle2 { } } - minCounts.foreach((p: (String, Int)) => { - power *= p._2 - }) + minCounts.values.foreach((count: Int) => power *= count) return power }