Skip to content

Commit 2280d4a

Browse files
ctruchiCLOVIS-AI
authored andcommitted
tp9 step 5 solution
1 parent f80d759 commit 2280d4a

File tree

1 file changed

+7
-1
lines changed
  • tp9/src/main/kotlin/fmt/kotlin/fundamentals

1 file changed

+7
-1
lines changed

tp9/src/main/kotlin/fmt/kotlin/fundamentals/Cellar.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ data class Cellar(
3737
}
3838

3939
companion object {
40-
fun fillCellar(cellar: Cellar, bottles: List<Bottle>, tanks: List<Tank>): Cellar = TODO()
40+
fun fillCellar(cellar: Cellar, bottles: List<Bottle>, tanks: List<Tank>): Cellar = cellar
41+
.apply {
42+
bottles.forEach { addBottle(it) }
43+
}
44+
.apply {
45+
tanks.forEach { addTank(it) }
46+
}
4147
}
4248
}

0 commit comments

Comments
 (0)