Is Graph Bipartite? LeetCode Solution

Problem Statement Is Graph Bipartite LeetCode Solution- There is an undirected graph with n nodes, where each node is numbered between 0 and n – 1. You are given a 2D array graph, where graph[u] is an array of nodes that node u is adjacent to. More formally, for each v in graph[u], there is an undirected edge between node u and node v. The graph has …

Read more

Course Schedule II – LeetCode

You have to attend n number of courses (from 0 to n-1) where some of the courses have prerequisites. For instance: pair [2, 1] represents to attend course 2 you must have taken course 1. Given an integer n representing the total number of courses and the list of courses …

Read more

Translate »