Apple interview question

Two pointers, DFS, BFS, sliding window, etc