← Questions

Cheapest way to make product sizes distinct

0
AmazonCodingLast asked Jul 2025

Products have sizes size[i], and raising product i's size by one costs cost[i]. Sizes may only grow. Return the least total cost to make all sizes distinct. The same screen also had a short movie-recommendation coding task.

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