Search
⌘K

Leetcode 2735. Collecting Chocolates

Given an array of costs and a fixed cost x to cyclically shift all types by one, minimize the total expense to buy one of each type by choosing how many global shifts to perform and, for each position, picking the cheapest available original item after those shifts. The core challenge is balancing the per-shift global cost against cheaper shifted purchases, which reduces to evaluating up to n cyclic offsets and taking per-index minima across shifted costs plus rotation cost.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.