Skip to content

Instantly share code, notes, and snippets.

View saldisobi's full-sized avatar

Sourabh Saldi saldisobi

  • Berlin
  • 05:59 (UTC -12:00)
View GitHub Profile
class Solution {
fun canFinish(numCourses: Int, prerequisites: Array<IntArray>): Boolean {
val indegree = IntArray(numCourses)
prerequisites.forEach{preArr->
val dependentCourse = preArr[0]
indegree[dependentCourse]++
}
val queue = LinkedList<Int>()