Pergunta de entrevista da empresa TikTok

They asked me the water jug problem, which can be solved with either BFS or DFS.