The solution provided in the video uses a slight moderation of Sliding window algorithm. Some other solutions may perform search on all the windows either by using linear serach or binary search but these methods may result in TLE.
Link to the problem: https://leetcode.com/problems/frequen...