Doesn't that dfs solution with max() simply return whatever branch had the node with highest number stored in it? What if the 2 branches are same length, but one of those contains 2 and other contains 3? Then it seems that "3" would be chosen when using that algo. That doesn't seem correct, because it's choosing based on the number stored, instead of depth.
Thanks for posting that tutorial. So far 3 coding interviews had DFS. First one I think I completed successfully without knowing what DFS was (although could have been faster) and the interviewer said "Wow, it was as though invented DFS from scratch in this interview". Sadly wasn't hired to that position. Next was a color bucket photoshop style coding question, and next was a island sizes question or similar. Posting tutorials of all of those would be nice.
I restartwr leetcode after an year recently and startee somving knoy easy problema topic wise and as i was solving day 1 was good then day 2 i felt sruck so many times at evey problm matrix, subaaarrays, susbsets, priority quque, for now how do i like gwt good at these i want to but they make me uninterested just looking at them i feel stupid
Hey Shiva, it's very normal and it happens with almost everyone. My advise is instead of grinding more problems, learn the patterns first and it'll all make sense. Also start with the highest ROI patterns first, for a list check out: algo.monster/problems/stats
@@algo.monster I have taken the test and it is asking me to pay to learn can I do that without paying like I choosed the10 week plan and I want to like learn I like it seemed worth a try but then onclicking next it asked for subscription man I can't pay anything now is there anything free like this in ur site without subscription requirement and j will watch all videos in ur channel from now to catch up
Flowchart to decide which algo to use: algo.monster/flowchart
Doesn't that dfs solution with max() simply return whatever branch had the node with highest number stored in it? What if the 2 branches are same length, but one of those contains 2 and other contains 3? Then it seems that "3" would be chosen when using that algo. That doesn't seem correct, because it's choosing based on the number stored, instead of depth.
Thanks for posting that tutorial. So far 3 coding interviews had DFS. First one I think I completed successfully without knowing what DFS was (although could have been faster) and the interviewer said "Wow, it was as though invented DFS from scratch in this interview". Sadly wasn't hired to that position. Next was a color bucket photoshop style coding question, and next was a island sizes question or similar. Posting tutorials of all of those would be nice.
Glad it helped! And yes DFS is the most commonly used interview algo!
You don't "need" to backtrack unless you're doing DFS, if you do BFS you can also get the depth and you don't "need" to backtrack
I restartwr leetcode after an year recently and startee somving knoy easy problema topic wise and as i was solving day 1 was good then day 2 i felt sruck so many times at evey problm matrix, subaaarrays, susbsets, priority quque, for now how do i like gwt good at these i want to but they make me uninterested just looking at them i feel stupid
Hey Shiva, it's very normal and it happens with almost everyone. My advise is instead of grinding more problems, learn the patterns first and it'll all make sense. Also start with the highest ROI patterns first, for a list check out: algo.monster/problems/stats
@@algo.monster does this channel have Instagram?
@@algo.monster I have taken the test and it is asking me to pay to learn can I do that without paying like I choosed the10 week plan and I want to like learn I like it seemed worth a try but then onclicking next it asked for subscription man I can't pay anything now is there anything free like this in ur site without subscription requirement and j will watch all videos in ur channel from now to catch up
@@algo.monster hey man thanks for the reply though
There is really no need for the background music, it's just annoying and distracting!