Sale
Summer Offer: $190/yr $99/yr
00 : 00 : 00 : 00
Get this deal
Backend Engineering Senior programming

LeetCode #207 - Course Schedule

You are given an array of prerequisites where prerequisites[i] = [a, b] indicates that to take course a you must first take course b. Return true if you can finish all courses.
Input:
numCourses = 2, prerequisites = [[1,0]]
Output:
true
Constraints:
1 <= numCourses <= 2000
0 <= prerequisites.length <= 5000
prerequisites[i].length == 2
All prerequisite pairs are unique.
Suggested Answer

Trusted by 100+ professionals preparing for interviews

Trusted by 100+ professionals 50+ Company Question Banks 5+ Supported Languages

Practice More Questions Like This

Generate unlimited interview questions with structured answers, code runner, and AI-powered walkthroughs.

Get Started Free

More Backend Engineering Interview Prep

Describe a challenging project you worked on. What were the prerequisites for success, and how did you overcome the challenges?
Software Engineering · Senior
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Link copied to clipboard