plz identify the mistake and provide the corrected code…
first output is wrong and second one is the ideal one…
problem link:https://www.hackerearth.com/practice/algorithms/graphs/breadth-first-search/practice-problems/algorithm/agitated-chandan/description/