Search
⌘K

Leetcode 3016. Minimum Number of Pushes to Type Word II

Assign each distinct letter in the word to a press-count position (typing a letter costs its position index on the key) subject to at most 8 letters per position (one per key 2–9) to minimize the total weighted sum of frequencies × positions. This is a capacity-constrained assignment solved by sorting letter frequencies and greedily giving the highest frequencies the smallest available positions.


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.