Altimetrik interview question

Javascript - Two sum problem