Problem Statement | |||||||||||||
We can think of a cyclic word as a word written in a circle. To represent a cyclic word, we choose an arbitrary starting position and read the characters in clockwise order. So, "picture" and "turepic" are representations for the same cyclic word. You are given a String[] words, each element of which is a representation of a cyclic word. Return the number of different cyclic words that are represented. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | words will contain between 1 and 50 elements, inclusive. | ||||||||||||
- | Each element of words will contain between 1 and 50 lowercase letters ('a'-'z'), inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
|