Groups
Category
Think Backwards is a problemโsolving pattern where you reverse time or direction so hard deletions become easy insertions and the final state becomes the starting point.
The Harmonic Lemma says that the values of \lfloor n/i \rfloor only change about 2\sqrt{n} times, so you can iterate those value blocks in O(\sqrt{n}) instead of O(n).