Amazon interview question

Design a graph traversal algorithm to count islands