TikTok interview question

Sliding window leetcode hard problem