String Shift
Start Timer
0:00:00
Given two strings A
and B
, write a function can_shift
to return whether or not A
can be shifted some number of places to get B
.
Example:
Input:
A = 'abcde'
B = 'cdeab'
can_shift(A, B) == True
A = 'abc'
B = 'acb'
can_shift(A, B) == False
Recommended questions for you
Personalized based on your user activity, skill level, and preferences.
.
.
.
.
.
.
.
.
.
Comments