Pregunta de entrevista de Procter & Gamble

Matching patterns and some math problems