← Questions
Count pairs of numbers that are digit rotations of each other
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Two numbers form a pair when they have the same number of digits and one becomes the other by moving some leading digits to the end (a rotation; no rotation counts too). Given an array, count the index pairs i < j that form a pair. Map each number to a canonical form, such as its smallest rotation, and count equal forms.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
