Posts
-
Sliding-Window Average in O(m) Time
-
Maximum Contiguous Subarray: Kadane’s Algorithm
-
Naive Recursive Fibonacci: Why It Explodes and How to Fix It
-
Remove Duplicates from a Sorted Array
-
Random Ants on a Stick: Expected Time Until All Fall Off
-
Order Statistics of Uniform(0,1): Max and Min
-
In-Place Variable Swap: No Temp Needed
-
Efficient Polynomial Evaluation with Horner’s Rule
-
Biased Gambler’s Ruin: Unequal Initial Fortunes
-
Dice Duel: Rolling a 12 Before Two Sevens in a Row
-
Correlation of Min and Max of Two Uniform Variables
-
Color Consensus: Expected Steps to Uniformity
-
Penney’s Game: Waiting Times, Sequence Races, and Optimal Strategies
-
The Noodle Connection Puzzle: Expected Number of Loops
-
The Meeting Problem: Will They Overlap?