Your Submissions
You haven't submitted any code for this challenge yet. Solve the problem by passing all the test cases, and your submissions will appear here.
xxxxxxxxxx
135
var assert = require('assert');
class UnionFind {
constructor(n) {
// fill in this method
}
hasCycle(adjacencyList) {
// fill in this method
}
union(i, j) {
// fill in this method
}
find(i) {
// fill in this method
}
}
class Graph {
constructor() {
this.adjacencyList = new Map();
this.verticesCount = 0;
}
addVertex(nodeVal) {
OUTPUT
Results will appear here.