Walmart interview question

BFS and DFS Greedy algorithm