congr / world

2 stars 1 forks source link

LeetCode : 796. Rotate String #453

Closed congr closed 5 years ago

congr commented 5 years ago

https://leetcode.com/problems/rotate-string/ image

congr commented 5 years ago
class Solution {
    public boolean rotateString(String A, String B) {
        if (A.length() != B.length()) return false;

        return (A+A).contains(B);
    }
}