Search
⌘K

Leetcode 3389. Minimum Operations to Make Character Frequencies Equal

Given a lowercase string s, compute the minimum number of operations (delete, insert, or change a character to its next alphabet letter — no wrap from 'z' to 'a') to transform s into a "good" string where every character present occurs the same number of times. The core challenge is choosing the final set of distinct letters and target frequency while respecting that character changes can only move forward in the alphabet and length can be adjusted by inserts/deletes.


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.