It is about how to choose btw. BFS and DFS. My init thought was to DFS - TLE\MLE. And its editorial gives a very neat BFS based idea which costs much less memory.
https://www.hackerrank.com/challenges/beautiful-path/editorial
Tony's LogAlgorithms, Distributed System, Machine Learning |
It is about how to choose btw. BFS and DFS. My init thought was to DFS - TLE\MLE. And its editorial gives a very neat BFS based idea which costs much less memory.
https://www.hackerrank.com/challenges/beautiful-path/editorial