Two Sigma Interview Question

Find friend circles