mirror of https://github.com/hykilpikonna/AquaDX
[F] Fix out of bounds
parent
ef5d0a81eb
commit
b333045d41
|
@ -25,6 +25,7 @@ fun findTrend(log: List<TrendLog>): List<TrendOut> {
|
|||
|
||||
// O(n log n)
|
||||
val d = log.filter { it.date >= minDate }.sortedBy { it.date }.toList()
|
||||
if (d.isEmpty()) return emptyList()
|
||||
|
||||
// Precompute the play counts for each date in O(n)
|
||||
val playCounts = d.groupingBy { it.date }.eachCount()
|
||||
|
|
Loading…
Reference in New Issue