Chubb interview question

Two sum from leetcode with python