Amazon Interview Question

Solve island matrix algorithm which is just a leetcode question to memorize