Given an undirected graph as an adjacency list `graph` (where `graph[u]` lists the neighbors of `u`), return `true` if the graph is **bipartite**.
A graph is bipartite if its nodes can be split into two sets such that every edge connects a node in one set to a node in the other.
Example 1
Input:graph = [[1,3],[0,2],[1,3],[0,2]]
Output:true
Explanation:Split into {0,2} and {1,3}.
Example 2
Input:graph = [[1,2,3],[0,2],[0,1,3],[0,2]]
Output:false
Explanation:Odd cycle 0-1-2-0.
Constraints
- 1 <= graph.length <= 100
- graph[u] does not contain u and has no duplicates
- The graph may be disconnected