It is about how to choose btw. BFS and DFS. My init thought was to DFS - TLEMLE. And its editorial gives a very neat BFS based idea which costs much less memory.
https://www.hackerrank.com/challenges/beautiful-path/editorial
It is about how to choose btw. BFS and DFS. My init thought was to DFS - TLEMLE. And its editorial gives a very neat BFS based idea which costs much less memory.
https://www.hackerrank.com/challenges/beautiful-path/editorial