Google interview question

island binary three problem leetcode medium