Group Shifted String
S.length = T.length
and
S[i] = T[i] + K for
1
<
= i
<
= S.length for a constant integer KInput : str[] = {"acd", "dfg", "wyz", "yab", "mop",
"bdfh", "a", "x", "moqs"};
Output : a x
acd dfg wyz yab mop
bdfh moqs
All shifted strings are grouped together.a c d -> 2 1
d f g -> 2 1
m o p -> 2 1Last updated