Pregunta de entrevista de Cvent

One coding question on matrix and string