TikTok Interview Question

Graph question related to bipartite graphs