I always enjoy your way of solving the Problem. The way you approaches the solution by breaking it is just an absolute masterclass. Very nice explanation.
While performing kahns algorithm for the example, our toposort will break at 2 because of indegree due to 7 although it is not part of cycle. How to handle this case
it will be handled becoz when we stop we will check if it is a cycle of len 2 which it will say false. we dont care if it is actually a cycle :) So, it will work fine.
Need to know them and practice. Like how you sort using Insertion sort and Heap Sort. Both does the same thing with different data structures and algorithms :) Here, cycle detection and its size was main. Similar to strongly connected components.
Thanks man, I am out of words to appreciate your efforts and explaination.
🙏🏼
This is absolute perfection.
I can't fathom how you solved the problem yourself.
i had solved with kosaraju but changed to topological sort for explanation :)
@@techdose4u, you created condensed graph and then from condensed node, find largest depth after graph reversal?
One of the toughest problems but increases logical thinking
for sure. I enjoyed this too ❤️
I always enjoy your way of solving the Problem. The way you approaches the solution by breaking it is just an absolute masterclass. Very nice explanation.
Thanks for your consistent appreciation 🙏🏼
You know it's a REALLY HARD question when Techdose's solution video is 52 minutes long!
True :o
coming up with such solution is nothing but respect. CRAZY. i thought normal bfs would work but the couple wala is such a big messs
yea true
🙏🙏🙏 Thank You Sir, best video for this problem.
🙏🏼
Never thought a solution for leetcode problem goes 100+ lines 😮
There will be one line masters still for this question on leetcode :)
One of the toughest problems in leetcode.
definitely
thank you
Welcome
OG sir🙇♂
Hope you enjoyed the LOOOONG problem analysis 🤣
Hard to go to right direction 😎
Now the direction is set :)
Very nice explanation
thanks :)
Techdose explanations >>>>>>>>>>>>>>>> Neetcode
By God’s grace 🙏🏼
While performing kahns algorithm for the example, our toposort will break at 2 because of indegree due to 7 although it is not part of cycle. How to handle this case
it will be handled becoz when we stop we will check if it is a cycle of len 2 which it will say false.
we dont care if it is actually a cycle :)
So, it will work fine.
Yeah, understood it after watching the video again. Thanks a lot for these great explanations.
If after solving this, the companies ask for any technical rounds.... i will ghost them.
🤣🤣
Like how we know this type of d/f algo kosaraju there will be lot of d/f how to rememeber it all.
Need to know them and practice.
Like how you sort using Insertion sort and Heap Sort.
Both does the same thing with different data structures and algorithms :)
Here, cycle detection and its size was main. Similar to strongly connected components.
@@techdose4u This is first time i have seen new algorithm like this type how to explore algorithm all d/f kinds.
nice
Thanks
Why tail of one side is evaluated only while in explanation both side tail lenght is considered in 2 length cycle
Both side are taken.
It is evaluated in a for loop.
So the nodes will be considered separately.
how you
able to solve this question ....
with patience and experience :)
87/98 test cases are passing and getting TLE. pls help
which soln ?
@@techdose4u my code. can i mail it to you?
:)