Maximize revenue by selling items with diminishing price

Problem: Maximize store revenue (price decreases as stock decreases)

You run a store with n product types. Product i has current stock quantity[i].

  • The current price of an item equals...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: