3 ms·
If you have not worked on any topological sorting for the past 15 years you will not remember how to do it under the pressure of time. in a new language etc. yo
by cowl 5y ago
If you have not worked on any topological sorting for the past 15 years you will not remember how to do it under the pressure of time. in a new language etc. you will need some time to remember the correct algorithm, how to adapt the data structures to the current language you are working on etc. And unless the problem is specified exactly as such, the most difficult thing is to come up with the idea that a given problem can be formulated as a topological sort problem, that is 80% of the solution. I am sure that most Experienced engineers when given this problem as a home task will come up with a correct solution even if they fail the time pressured leetcode.