Bloomberg interview question

Number of islands and then encode decode binary tree