i want to learn bfs & dfs,can someone provide me stl(c++) implementation of bfs?

you are gettin WA…because if n==0 then ans=0 not 1.

how can i access map as a vector means how can i use map as vector there?how to access?

Hey Buddy i was also stuck to implement dfs. but i got exact way to come out. Go for these tutorials will get u know about both implementation and explanation.

[link 1][1]

[link 2][2]

it will help u lot :slight_smile:
[1]: https://youtu.be/uT1p5Eiw9CE
[2]: https://youtu.be/fI6X6IBkzcw

why we are getting wa,please help us