LeetCode/kt/rotate-string.kt

7 lines
149 B
Kotlin
Raw Permalink Normal View History

class Solution {
fun rotateString(
s: String,
goal: String,
): Boolean = s.length == goal.length && (s + s).contains(goal)
}