sir, here in this code if I use set then, I am getting correct output but not with the min heap. why
About logic of code
hello @gargshivam2001
pls save ur code on cb ide and share its link with me, i want to check ur approach
u need to push in queue ,only if it is not inserted before in heap.
make an additional visited array to keep track of all visited cells
when u inserting new cells then mark them visited as well