Pregunta de entrevista de UBS

Then again a DSA question on 2d array/vectors