[LeetCode] Minimum Time to Revert Word to Initial State II

1 · · Feb. 4, 2024, 5:40 a.m.
3031. Minimum Time to Revert Word to Initial State II You are given a 0-indexed string word and an integer k. At every second, you must perform the following operations: Remove the first k characters of word. Add any k characters to the end of word. Note that you do not necessarily need to add the same characters that you removed. However, you must perform both operations at every second. Return the minimum time greater than zero required for word to revert to its initial state. ...