Available question text
Given a string and integer k where each second you remove the first k characters and append any k characters, find the minimum positive t so the string can return to its original form. This reduces to finding the smallest t such that the prefix of length n - t*k equals the suffix starting at t*k (i.e., a prefix-suffix overlap condition), which can be detected with linear-time string-overlap algorithms.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 3031. Minimum Time to Revert Word to Initial State II
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source