Google Interview Question

Linked list version of the "Island Counting" problem