Skip to content

Instantly share code, notes, and snippets.

@sdmcraft
Created August 29, 2021 07:22
Show Gist options
  • Save sdmcraft/0ca645c082d9ebaedf01856df605293f to your computer and use it in GitHub Desktop.
Save sdmcraft/0ca645c082d9ebaedf01856df605293f to your computer and use it in GitHub Desktop.
import java.util.ArrayList;
import java.util.List;
class Solution {
public boolean canFinish(int numTasks, int[][] prerequisites) {
...
for (int i = 0; i < numTasks; i++) {
if (adjacencyList[i] != null) {
return false;
}
}
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment