All challenges
intermediateData Structures & Algorithms~45 min

Quadtree

Index 2-D points so 'what's in this region?' is fast instead of a full scan. Build the bounding-box math, insert points, subdivide a node into four quadrants when it fills up, and answer rectangular range queries — the spatial tree behind collision detection, maps, and nearest-neighbor search.