This is my solution to LeetCode 1557. Minimum Number of Vertices to Reach All Nodes. We used a set to track all the nodes in the beginning, then iterated over all edges to remove the nodes where we could traverse to.
Click here for my solution
https://bit.ly/3OqfDAv
Click here for more resources
https://bit.ly/45cjiYO