Help me out in one problem


my 4 test cases is not passing in one hackerank problem .i have also question link here in this code

can anyone tell why?

@shivammishra20121999
Your implementation of bfs is wrong. Because of the for loop, all the computations will have on the queue, i.e, all of the elements of the queue will be accessed and current wont be increased. Please implement bfs correctly. Also you do not need a current variable. When you are accessing the child nodes of a parent node, distance of the child will be equal to 6 + distance of parent from source node. Correct that.
Please revert in case you face any difficulty.