Given k alphabets and a length of n, find how many unique strings can be formed using these k alphabets of length n. Two strings are considered same if one can be obtained from another through rotation or through reversing.
Given k alphabets and a length of n, find how many unique strings can be formed using these k alphabets of length n. Two strings are considered same if one can be obtained from another through rotation or through reversing.
Can anyone help me provide a critical test case for this problem ?
my solution: http://ideone.com/JDfL7D