Zalando Interview Question

medium leetcode problem related to graphs and sorting