Created
July 8, 2019 09:13
-
-
Save manojnaidu619/b655de95ea5da86f376933b7973fb33b to your computer and use it in GitHub Desktop.
Leetcode Solution for "Rotate String" in Ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rotate_string(a, b) | |
return false if a!=b && a.length != b.length | |
a = a*3 | |
return true if a.include?(b) | |
return false | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment