Count Distinct Cyclic Number Pairs

Given an integer array A, two numbers x and y form a cyclic pair if:

  1. their decimal representations have the same length;
  2. y can be obtained by cyclically rotating the decimal string ...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: