← Questions
Budget queries on a sorted price list, then a shortest path
0
I was asked this
No reports yet. Sign in to say where you were asked it.
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 official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
