Count Cyclic Rotation Pairs

Given an array of positive integers a, count index pairs (i, j) such that 0 <= i < j < len(a) and:

  1. a[i] and a[j] have the same number of decimal digits.
  2. a[j] can be obtained by cycl...

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: