Pregunta de entrevista de Microsoft

leetcode question about string and matrix