Microsoft interview question

sliding window, greedy algorithm, DFS and BFS