Available question text
Determine whether t is a rotation of s; if so, count the number of k-length sequences of nonzero suffix-rotations (moves that rotate s by l positions for 1 ≤ l ≤ n−1) whose combined rotation equals the shift mapping s to t, modulo 1e9+7 — otherwise return 0. The core challenge is counting k-tuples from Z_n\{0} whose sum equals the target shift under large constraints (n up to 5e5, k up to 1e15).
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 2851. String Transformation
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source