Solved ShortestRepetition.