Algorithm · Karat · Medium
This problem has two parts set in a university's course system. Part 1: The system is fed a list of enrollment records, each one a pair of a student ID and a course the student is taking. For every possible pair of students in the data, produce the set of courses that both of them are enrolled in. Part 2: You are now given a graph describing course prerequisites, where an edge links a course to a course that follows it. Each student's track is a sequence of courses through…