Problem 2146 · Medium

K Highest Ranked Items Within a Price Range

Pick the k best-ranked priced items that are reachable from a start cell within a distance cap. The visual grows a breadth-first wave outward over the grid and marks the qualifying items as they are ranked.

Open the interactive visualisation