DatabricksOA #15
Count Cyclic Pairs
估计中等评测数据准备中,可先阅读题面
tomtom's note: Feel free to check out the source image below for the original problem statement :) Once upon a time, there was a magical array of numbers, each with its own unique set of digits. These numbers had a secret ability: they could rearrange themselves by performing a special move called a "cyclic shift." This meant they could take some digits from the end and move them to the front, while shifting all the other digits over in the same order. If two numbers could be transformed into each other through this shifting magic, they were known as "cyclic pairs."