Count Rotations With Exactly K Equal Adjacent Pairs
Move each prefix to the end of the string and count the rotations whose linear text has exactly k equal neighbouring pairs.
Move each prefix to the end of the string and count the rotations whose linear text has exactly k equal neighbouring pairs.