Implement flood fill using BFS and DFS | Apple Interview Question