Pergunta de entrevista da empresa Amazon

Matrix/ graph sort of question was one. Rotten oranges / num of islands variation.