Dedalus interview question

Two sums javascript. Can be found on leetcode