8. Tricky DFS BFS Question | LeetCode 967 - Numbers With Same Consecutive Differences- C++,JAVA Code

preview_player
ะŸะพะบะฐะทะฐั‚ัŒ ะพะฟะธัะฐะฝะธะต
LeetCode link to the Question -

๐‚๐ก๐ž๐œ๐ค๐จ๐ฎ๐ญ ๐๐ž๐ญ๐š๐ข๐ฅ๐ฌ ๐š๐ง๐ ๐ž๐ง๐ซ๐จ๐ฅ๐ฅ ๐Ÿ๐จ๐ซ ๐จ๐ฎ๐ซ ๐‹๐ˆ๐•๐„ ๐œ๐จ๐ฎ๐ซ๐ฌ๐ž๐ฌ ๐ก๐ž๐ซ๐ž-

You can also connect with me on-

You can follow The Literate Store here-

The video contains following parts-
0:00-0:45 - Intro
0:45-1:45 - Reminders
1:45-9:00 - Problem Explanation and Intuition
9:00-15:45 - DFS code in CPP
15:45-25:00 - BFS code in CPP
25:00-33:05 - DFS code in JVA
33:05-39:10 - BFS in JAVA
39:10-41:30 - BFS Dry Run

#graphs #dsa #software developer #dsalgo
ะ ะตะบะพะผะตะฝะดะฐั†ะธะธ ะฟะพ ั‚ะตะผะต
ะšะพะผะผะตะฝั‚ะฐั€ะธะธ
ะะฒั‚ะพั€

in the bfs code the reason behind the : here you might be thinking why len<n and not <=n it is because we have to get the the total of n digits in each number, we are already adding one digit at the start for each number(initialization of queue) so after that only n-1 digits remains that is the reason one less iteration .

Gaurav_
ะะฒั‚ะพั€

Why in the BFS approach, the while loop needs to check for q.empty()? The condition of len<n shouldn't be enough?

sudiptosaha
ะะฒั‚ะพั€

I've done graphs before but seeing you cover not those common sheet questions but some new concepts/questions I'm hopeful that I'll be able to improve my understanding of graphs.
Amazing content, waiting for more!

adik
ะะฒั‚ะพั€

Nice work
It's getting clear now
Thank you for putting so much effort

kushalbhargava
ะะฒั‚ะพั€

Took 3 hrs but finally understood thnx so much maam

techkunbyamogh
ะะฒั‚ะพั€

first time commenting on this channel. This is truely amazing content. Teaching style is amazing. I am encouraged to take a paid course from you after this. Thanks a Lot Keerti. :)

kanchanmishra
ะะฒั‚ะพั€

Today's leetcode question was really good and I felt dfs quite easier than bfs and today was a lot to take in. Understood the concept really well mam will practice on own once. Thanks keerti mam.๐Ÿ‘๐Ÿป๐Ÿ˜€

harshav
ะะฒั‚ะพั€

Generally, in graph problems we use a visited boolean array, however in the solution visited array was not used.then does make it a graph question?

karthikramachandran
ะะฒั‚ะพั€

you should consider uploading whole series at once the way striver did.
For 2 reasons:
i) People who are really learning can't just stop at one question a day, hence wont stick to your series
ii) Looking at your initial videos the quality is just the best, but want to solve non trivial ones i dont have the video now so i'll do from some other place and wont need that video ever so not getting that one view.

ajinkya-wasnik
ะะฒั‚ะพั€

Hi ma'am
dsa+ java+spring boot.
Are there vacancy for these jobs for fresher please help I am very needy right now.

abhinjr
ะะฒั‚ะพั€

Hi Keerti I would like to enroll for DSA . But I have few questions

ramankingdom
ะะฒั‚ะพั€

keerti its 929 not 909 just got swipped

venkateshjacke
ะะฒั‚ะพั€

BFS size wala part still not very much clear :) looking forward with many videos to get clearer soon

Raj