OpenGov interview question

Solve the problem Two Sum (from LeetCode)