HashedIn by Deloitte interview question

Find islands using hashmaps, write the code or explain algo