Meta Interview Question — LeetCode 1136

Y Tech
2 min readMar 7, 2022

In this post, we are going to discuss leetcode 1136 — Parallel Courses, which is asked in Meta interviews.

Problem Analysis

You are given an integer n, which indicates that there are n courses labeled from 1 to n. You are also given an array relations where relations[i] = [prevCoursei, nextCoursei], representing a prerequisite relationship between course prevCoursei and course nextCoursei: course prevCoursei has to be taken before course nextCoursei.

In one semester, you can take any number of courses

--

--