HackerRank problem: Roads and Libraries https://www.hackerrank.com/challenges/torque-and-development/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=graphs
This is a HackerRank problem in the Interview Preparation Kit. Latelly I have spent a lot of time working on LeetCode problems. It seems there are some very good problems at HackerRank.
If interested in this problem, my approach and comments, please read the following post in my blog:
https://www.johncanessa.com/2021/05/17/roads-and-libraries/
Keep in mind that the best way to learn is to read and experiemnt.
Enjoy;
John