Sunday afternoon Problem: Lazy Sequences as a Dynamic Programming Primitive in Kotlin
Dynamic programming is usually taught with mutable arrays and index arithmetic — Kotlin’s generateSequence and sequence { } let you express the same recurrences as infinite, lazily-evaluated streams. Background Classic dynamic programming (DP) involves filling a table bottom-up: allocate an… Continue Reading
