TikTok interview question

leetcode question (two sum) oop