mirror of
https://github.com/hykilpikonna/AquaDX.git
synced 2026-05-15 00:29:52 -05:00
[F] Fix index out of bounds
This commit is contained in:
parent
f3090870be
commit
ff9358b986
|
|
@ -25,6 +25,7 @@ fun findTrend(log: List<TrendLog>): List<TrendOut> {
|
|||
|
||||
// O(n log n)
|
||||
val d = log.sortedBy { it.date }.toList()
|
||||
if (d.isEmpty()) return listOf()
|
||||
|
||||
// Precompute the play counts for each date in O(n)
|
||||
val playCounts = d.groupingBy { it.date }.eachCount()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user