In this video, I explained the solution to Codeforces Round #656 (Div. 3) Problem E: Directing Edges.
Before watching the video, try to solve the problem on your own here: https://codeforces.com/contest/1385/problem/E
See my solution here: https://repl.it/@LotusFlower7/Directing-Edges#main.cpp
If you want to read further into topological sorting, here is a good article: https://www.geeksforgeeks.org/topolog.... A simple Google search will give you many other great articles too.
Here is another problem that requires topological sort that I went over before: https://www.youtube.com/watch?v=yyrOo8YCsFc
Thank you for watching and make sure to check out other videos!
This video was created by Edward from TheCodeBakery.
Looking to learn how to code apps, games, and websites for free? Subscribe and sign up at thecodebakery.herokuapp.com.