Slide 38
Slide 38 text
groupBy͍ͬͯ͏ϝιου͋Γ·ͨ͠ΑͶʁ
data class ScoreRecord(
val stageId: Int,
val score: Int
)
val scoreRecordList = listOf(
ScoreRecord(stageId = 0, score = 1),
ScoreRecord(stageId = 0, score = 3),
ScoreRecord(stageId = 1, score = 2),
ScoreRecord(stageId = 0, score = 1),
ScoreRecord(stageId = 2, score = 4)
)
val map: Map> = scoreRecordList.groupBy { it.stageId }