Concepts3
βοΈAlgorithmIntermediate
Think Backwards (Reverse Thinking)
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.
#think backwards#reverse thinking#offline queries+12
βMathIntermediate
Harmonic Lemma
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).
#harmonic lemma#integer division trick#block decomposition+12
πTheoryIntermediate
Attention Mechanism Theory
Attention computes a weighted sum of values V where the weights come from how similar queries Q are to keys K.
#attention#self-attention#multi-head attention+12