You're given an undirected graph represented as an adjacency list. Determine if it's bipartite: can you color every node with one of colors so that no two adjacent nodes share the same color? Google asks graph coloring problems to test your BFS/DFS skills and ability to reason about graph properties.
For graph = [[1,3],[0,2],[1,3],[0,2]], the answer is true. Color nodes and red, nodes and blue. No edge connects same-color nodes.
Think about what would make a graph NOT bipartite. What structure would force two adjacent nodes to share a color?
Constraints: , no self-edges, no duplicate edges.