Pregunta de entrevista de Schrödinger

Started with DSA question on array