Pocket Gems interview question

Matrix Traversal - Island Problem