Dayforce Interview Question

Leetcode Two Sum solve it.