Pregunta de entrevista de Meta

how would you write code to traverse a matrix