Company: Texas
Difficulty: medium
Count Cyclic Number Pairs Two positive integers are a cyclic pair if they have the same number of decimal digits and one can be obtained from the other by moving zero or more trailing digits to the front. Count pairs of indices `i < j` that form a cyclic pair. Leading zeroes are never introduced because the inputs are positive integers written in normal decimal form. Input First line: `n`. Second line: `n` positive integers. Output Print the number of cyclic pairs. Constraints `1 ≤ n ≤ 100000`, `1 ≤ a[i] ≤ 10^9`. Example Input: `9 / 13 5604 31 2 13 4560 546 654 456` Output: `5`