Problem 11 (Recognizing Pattern)