Leetcode - 207. Course Schedule
U can read the question properly and give a try once before coming to the solution  Incase you have...
Tags: leetcode