LeetCode: Rotate String
Problem:
https://leetcode.com/problems/rotate-string/description/
Code:
# OPTIMISED
class Solution:
def rotateString(self, s: str, goal: str) -> bool:
return len(s)==len(goal) and goal in (s+s)
# BELOW TWO SOLUTIONS NOT (O(N^2))
# class ...
is-power-of-two.hashnode.dev2 min read