Find Minimum Price to Spend

Easypaypal

Problem Overview

  • Compute the minimum total price to buy all items using up to m coupons; for item i, using x coupons sets its cost to price[i] / 2^x.
  • Input: int[] price and int m; Output: int representing the minimum spend.
  • Context: e-commerce discounts and coupon optimization in a shopping cart.
  • This is a Paypal interviews problem, often seen as a coding interview interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: