Cheapest way to make product sizes distinct

0
Remix

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.

AmazonTechnical phone screenLast asked Jul 2025
No answer yet. Write the first one; the best answer gets endorsed.