Skip to content

Commit 785119d

Browse files
authored
fix typo
1 parent 625c586 commit 785119d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

docs/2023/puzzles/day22.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,9 @@ for disintegration:
188188

189189
```scala 3
190190
def getDisintegrableBricks(brickToSupportingBricks: Map[Brick, Set[Brick]]): Set[Brick] = {
191-
val nonDisintegrableBricks = brickToSupportingBricks.collect {
192-
case singleton if singleton.sizeIs == 1 =>
193-
// the only brick that holds the brick above
194-
singleton.head
191+
val nonDisintegrableBricks = brickToSupportingBricks.values.collect {
192+
case supporting if supporting.sizeIs == 1
193+
supporting.head // the only brick that holds the brick above
195194
}.toSet
196195
brickToSupportingBricks.keySet diff nonDisintegrableBricks
197196
}

0 commit comments

Comments
 (0)