Decrease runtime by increasing cache size.
All checks were successful
Solve / example-action (push) Successful in 3m16s

This commit is contained in:
2024-12-11 19:42:02 +01:00
parent 5fd63ac62f
commit aef2dc6159

View File

@@ -26,7 +26,7 @@ class PriorityCache<K, V>(private val maxSize: Int) {
return cache.containsKey(key)
}
}
val priorityCache = PriorityCache<String, Long>(20000)
val priorityCache = PriorityCache<String, Long>(50000)
fun getStonesAfter(input: List<Long>,iterations: Int, cache: PriorityCache<String, Long>): Long {
var sum = 0L
for (i in input) {