ByteDance Interview Question

Implement 2 sum with js/ts.