Swiggy interview question

Course schedule problem of leetcode