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:
Matej Focko 2024-11-03 20:16:21 +01:00
parent 5512ebaf6d
commit 340d234a4f
Signed by: mfocko
SSH key fingerprint: SHA256:icm0fIOSJUpy5+1x23sfr+hLtF9UhY8VpMC7H4WFJP8

6
kt/rotate-string.kt Normal file
View file

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