Dedalus Interview Question

Two sums javascript. Can be found on leetcode