Cycle Shift
Feel free to checkout the image source below for the original problem statement 🐰
In a world of numbers, a special kind of magic exists called the "cyclic shift." This mystical operation involves taking some digits from the end of a number and placing them at the beginning, while all the other digits move one step forward in perfect order. When performed correctly, this can transform one number into another. Now, imagine you are given two numbers, a and b, both with the same number of digits. These numbers are called "cyclic pairs" if, after performing a cyclic shift on a, it can become identical to b. You can shift none, some, or all the digits from the end of a to the front, and if it becomes equal to b, the pair is magical. Your quest is to take an array filled with positive integers and find how many such magical cyclic pairs exist. Specifically, you are tasked with counting all pairs i and j (where 0 ≤ i < j < a.length) such that the numbers a[i] and a[j] share the same number of digits, and one can become the other by performing a cyclic shift. How many of these hidden cyclic pairs will you discover on your journey through the array of numbers? The answer lies in your hands!
1Example 1

Constraints
Limits and guarantees your solution can rely on.