Two Sigma Interview Question

coding challenge was friend circle and word chain