Budget queries on a sorted price list, then a shortest path
Two problems in a 90-minute assessment. First, items come sorted by price; for each budget query, return how many items you can buy. A knapsack DP is too slow; prefix sums with binary search are the intended solution. Second, build a graph from the given input and find a shortest path between two nodes.
No answer yet. Write the first one; the best answer gets endorsed.
