All Posts

1276 articles

dsa1 min read

Strange Printer — Interval DP

Minimum turns to print string where each turn prints a contiguous run of same char. Interval DP: dp[i][j] = min turns for s[i..j].

Read →
dsa2 min read

Flood Fill — DFS Color Replace

Implement the flood fill algorithm (like paint bucket tool): replace all cells of the same color reachable from a starting cell.

Read →
Page 43 of 256