We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Thanks.
I totally agree with your point. But it will still remain a O(n) space solution. Though, it is always a good idea to use as less space as possible.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
BFS: Shortest Reach in a Graph
You are viewing a single comment's thread. Return to all comments →
Thanks. I totally agree with your point. But it will still remain a
O(n) space
solution. Though, it is always a good idea to use as less space as possible.