249. Group Shifted Strings

A shifting sequence is formed by shifting each character in a string by the same amount. For example, "abc" shifted by 1 becomes "bcd", shifted by 2 becomes "cde".

Given an array of strings, group all strings that belong to the same shifting sequence together. Return a list of groups, where each group is a list of strings. The order of the groups and the order of the strings inside each group may be any valid order; the examples below use first-encounter order.

Examples
Input: ["a","a"]
Output: [["a","a"]]
Hints
Related Problems

249. Group Shifted Strings

A shifting sequence is formed by shifting each character in a string by the same amount. For example, "abc" shifted by 1 becomes "bcd", shifted by 2 becomes "cde".