Domanda di colloquio di Microsoft

Two sum question and its time complexity.