Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 703 Bytes

_796. Rotate String.md

File metadata and controls

32 lines (21 loc) · 703 Bytes

All prompts are owned by LeetCode. To view the prompt, click the title link above.

Back to top


First completed : November 04, 2024

Last updated : November 04, 2024


Related Topics : String, String Matching

Acceptance Rate : 63.57 %


Solutions

Python

class Solution:
    def rotateString(self, s: str, goal: str) -> bool:
        return any(goal == s[i:] + s[:i] for i in range(len(s)))