TikTok interview question

leetcode questions like 3sum, find substrings