my code: https://ide.codingblocks.com/s/158803
problem: https://hack.codingblocks.com/app/contests/782/p/781
Did it using topological sort with dfs.
my code: https://ide.codingblocks.com/s/158803
problem: https://hack.codingblocks.com/app/contests/782/p/781
Did it using topological sort with dfs.