Open the Lock | Leetcode 752 | Live coding session | BFS

  Рет қаралды 5,217

Coding Decoded

Coding Decoded

Күн бұрын

Пікірлер: 30
@ananyaashrivastava2783
@ananyaashrivastava2783 3 жыл бұрын
Great explanation ! Can someone please explain the time complexity here?Thankyou.
@CodeWithSunchitDudeja
@CodeWithSunchitDudeja 3 жыл бұрын
I have mentioned it in one of the comments below
@dianayao1677
@dianayao1677 Жыл бұрын
Love this explanation ! can you please also explain the time complexity and space complexity? Appreciate it!
@Sailgodgreenearth
@Sailgodgreenearth 2 жыл бұрын
what a beautiful explanation. Loved it
@amazinglife5400
@amazinglife5400 3 жыл бұрын
Can't it be done by DFS approach also effectively? As I tried it like this in every traversal taking 2 different variations for individual digit of a lock and then passing on to next traversal making 8 new recursive possibilities for a single lock. Would it blew off time complexity?
@LegitGamer2345
@LegitGamer2345 3 жыл бұрын
its overkill to use dfs here
@pr4nshul
@pr4nshul 3 жыл бұрын
hey i had a doubt in line 20 , why are we checking whether the front of the queue is visited , as we are only pushing those states which are not visited in line 24 , video time 10:17
@Versole
@Versole 2 жыл бұрын
Nice explanation
@dhananjayseetha4251
@dhananjayseetha4251 3 жыл бұрын
You have messed up the example(which is also the first test case in challenge) where our target is 0202, what you are achieving is 2202 but we have to achieve 0202.See the video around 8:30
@CodeWithSunchitDudeja
@CodeWithSunchitDudeja 3 жыл бұрын
Thanks man for telling, I was simultaneously doing something my bad
@dhananjayseetha4251
@dhananjayseetha4251 3 жыл бұрын
​@@CodeWithSunchitDudeja Love you brother ,No problem you know amazing thing is viewers enhance the quality of instructor by poking out these things so that mistakes are not repeated.I hope you will pay attention next time 😁.Except this issue everything is perfect , keep up the good work bro 💥💥.
@mayanktiwari3103
@mayanktiwari3103 Жыл бұрын
finally undertood this problem
@kaushikkampli6911
@kaushikkampli6911 3 жыл бұрын
Is there a DFS or recursive counterpart to this solution? Great video though!
@LegitGamer2345
@LegitGamer2345 3 жыл бұрын
bro in questions like these its overkill to use dfs the code gets really complicated
@sanchitmehra1079
@sanchitmehra1079 3 жыл бұрын
awesome explanation :)
@CodeWithSunchitDudeja
@CodeWithSunchitDudeja 3 жыл бұрын
Glad you liked it!
@vinny4161
@vinny4161 7 ай бұрын
great bro thanks!!
@algorithmo134
@algorithmo134 3 жыл бұрын
Why does your code doesnt have modulus? I have seen many code that contain % operation in leetcode solution.
@CodeWithSunchitDudeja
@CodeWithSunchitDudeja 3 жыл бұрын
Why do you need it?
@algorithmo134
@algorithmo134 3 жыл бұрын
@@CodeWithSunchitDudeja reduces time complexity
@heyrmi
@heyrmi 3 жыл бұрын
Thank you.
@CodeWithSunchitDudeja
@CodeWithSunchitDudeja 3 жыл бұрын
Thnx
@tathagatnegi5923
@tathagatnegi5923 3 жыл бұрын
Thanks
@CodeWithSunchitDudeja
@CodeWithSunchitDudeja 3 жыл бұрын
Thnx
@LegitGamer2345
@LegitGamer2345 3 жыл бұрын
clean code gg
@CodeWithSunchitDudeja
@CodeWithSunchitDudeja 3 жыл бұрын
Thnx
@rogerop6721
@rogerop6721 3 жыл бұрын
what will be the time complexity ?
@CodeWithSunchitDudeja
@CodeWithSunchitDudeja 3 жыл бұрын
🧐, my hunch is somewhere around O(10^4)/2, as we are going from 0000 upto 9999. Dividing it by 2 since we always have 2 directions to go in. So Max you need to go up till O(5000).
@parikabajaj7756
@parikabajaj7756 3 жыл бұрын
✌️, simple
@CodeWithSunchitDudeja
@CodeWithSunchitDudeja 3 жыл бұрын
thnx
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 30 МЛН
Thank you Santa
00:13
Nadir Show
Рет қаралды 46 МЛН
No work in notice period!
0:59
Coding Decoded
Рет қаралды 995
5 Day a Week Work from Office! 2025 is coming!
0:57
Coding Decoded
Рет қаралды 1 М.
Core Java Coding Interview Questions and Answers
17:32
Coding Shinobi
Рет қаралды 157
Why 90% of Traders Fail (Don’t Be One of Them)
21:29
NewName Trading
Рет қаралды 629
4LPA CTC at IIT Bombay, Tier 3 hi better tha!
0:43
Coding Decoded
Рет қаралды 1,1 М.