Intuit interview question

algorithm for friends connections using graph