OKG Interview Question

2 of the coding rounds asked graph questions