kt: add «796. Rotate String»
URL: https://leetcode.com/problems/rotate-string/ Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
parent
5512ebaf6d
commit
340d234a4f
1 changed files with 6 additions and 0 deletions
6
kt/rotate-string.kt
Normal file
6
kt/rotate-string.kt
Normal file
|
@ -0,0 +1,6 @@
|
|||
class Solution {
|
||||
fun rotateString(
|
||||
s: String,
|
||||
goal: String,
|
||||
): Boolean = s.length == goal.length && (s + s).contains(goal)
|
||||
}
|
Loading…
Reference in a new issue