Amazon Interview Question

Leetcode style Q - course schedule II (medium difficulty)