Houzz interview question

Determine String repetition patterns?