Question bank › Dynamic Programming
Dsa Dynamic Programming Warm-up

Minimum Cost Pizza Delivery

You run a pizza delivery service and there are 'n' locations to which you deliver pizzas. Each location has a specific cost associated with delivering to it. Your delivery vehicle can deliver to multiple locations in one trip. The goal is to minimize the total delivery cost by choosing an optimal subset of those locations. Write a function to calculate the minimum total delivery cost to deliver to all locations. Input Format: - The first line contains the integer n (1 <= n <= 100). - The second line contains n space-separated integers indicating the delivery cost for each location. Output Format: - A single integer that is the minimum cost to deliver to all locations. Example: Input: 3 5 1 8 Output: 9 Note: You can take advantage of the lowest costs by selecting the optimal subset of locations to minimize total costs.

Key concepts

dynamic_programminggreedyoptimization

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of Praxari's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.