Google interview question

Linked list version of the "Island Counting" problem