Concepts2
⚙️AlgorithmIntermediate
Pigeonhole Principle Applications
The Pigeonhole Principle says if you put more items than boxes, at least one box must contain two or more items; this simple idea powers many algorithmic guarantees.
#pigeonhole principle#dirichlet principle#cycle detection+11
⚙️AlgorithmAdvanced
Digit DP - Advanced States
Digit DP counts integers in a range by scanning digits from most significant to least while maintaining compact state information.
#digit dp#tight flag#leading zeros+12