Shortest Path In a Binary Matrix | Leetcode 1091 | BFS traversal

preview_player
Показать описание

1) 0:00 Explaining the problem out loud
2) 1:10 Algorithm walkthrough
3) 7:15 Coding it up

Time complexity: O(n2)


Рекомендации по теме
Комментарии
Автор

Nicely explained, helps a lot, Thank you :)

varshatiwari
Автор

Hi,
Thanks for this solution. I am proud to say that I was able to develop intuition just as how you explained in the past BFS questions. All thanks to you brother :)

abhishekjain
Автор

bro one request, can you make a video on Cheapest Flights Within K Stops, as all techniques are are giving tle on leetcode. i recently got this ques in urban company oa too and did dfs with optimization it gave tle there too

pranavsharma
Автор

bro can we take a level 2d array andincrement the value of that pos in the level 2d array and return the levl[n-1][m-1]

pritishpattnaik
Автор

Also, don't you think that the question is quite misleading?. We are not doing any computation where we are finding any minimum path cost so reach the last cell, we are literally just doing the simple BFS traversal and nothing else?.

RajatSingh-dgov
Автор

Time Complexity would be O(N*N) where N*N is the size of the grid since we are going to touch all the points at least once for worst-case scenario?.

RajatSingh-dgov
Автор

Anyone who has done in c++ using a class like how bhaiya did in the video, please comment down your code; it would be beneficial.

avinash-xhqw
join shbcf.ru