Reddit interview question

Technical Interview: leetcode questions. not too bad.