simplified foreach loop
This commit is contained in:
1 parent
bd84c48a21
commit
8cbe1a8f52
1 file changed
+1
-3
@@ -40,9 +40,7 @@ object Puzzle2 {
|
||||
}
|
||||
}
|
||||
|
||||
minCounts.foreach((p: (String, Int)) => {
|
||||
power *= p._2
|
||||
})
|
||||
minCounts.values.foreach((count: Int) => power *= count)
|
||||
return power
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user