TikTok interview question

2 Leetcode style programming problems