Group Shifted String
1. You are given an array of strings. 2. You have to group the given strings in such a way that all strings in a group are shifted versions of each other. 3. Two strings s1 and s2 are shifted if - -> Length of both the strings is the same. -> The difference between ASCII values of every character of s1 and s2 is constant. Note -> Every string consists of lower-case English letters only.
1 <= N <= 10^4 1 <= length of a string <= 100
A number N str1 str2.. N space-separated strings
Every line of output contains space-separated strings which represents a group of shifted strings.
9 acd dfg wyz yab mop bdfh a x moqs
acd dfg mop wyz yab a x bdfh moqs