Search
⌘K

Leetcode 3137. Minimum Number of Operations to Make Word K-Periodic

Partition the string into n/k contiguous blocks of length k; each operation copies one block over another, so the problem reduces to making all blocks identical. The minimum operations equals the number of blocks minus the frequency of the most common block (i.e., pick the most frequent block and copy it to all others).


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.