Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
āK
Get Premium
Leetcode 2851. String Transformation
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).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.