HP Inc. interview question

Twosum (leetcode easy) and javascript