Algorithms you can watch run.

Hard CS, finally visual — DSA, the algorithms that matter, and how real systems work. An honest story, a visualization, and the intuition that makes it stick.

Latest

dsa

Sum any range in one subtraction

A precompute that takes O(n) once and turns every future range-sum query into a single subtraction — no matter how wide the range. The pattern feels illegal until you've built it.

dsa

Stop re-adding the same numbers

Brute force keeps re-adding the same overlapping numbers thousands of times. The sliding window updates with exactly two operations — no matter how wide the window. Here's the pattern, and where it goes next.

dsa

How to find the best streak in a single pass

There are millions of possible streaks in your data. Kadane's algorithm finds the single best one without checking almost any of them — here's the one idea that makes it work.

dsa

The nested loop you can almost always delete

Two pointers turns an O(n²) pair-search into a single elegant pass over a sorted array — and here's the intuition for why it can never miss.