Meta interview question

Some basic BFS, DFS and Two pointer problem