Pregunta de entrevista de Microsoft

Two sum question and its time complexity.