Split friends into two groups (graph problem) - effectively BFS tracking even and odd levels (bipartite check).
Asked in the coding stage.
Given an undirected graph represented as an adjacency list, return True if its vertices can be divided into two groups such that every edge connects vertices in different groups. Return False otherwise. The graph may be disconnected. The function receives graph, where graph[i] lists the neighbors of vertex i, and returns a Boolean.
def can_split_friends(graph):