## Question 1 What is the output if the following grid is given as input? $$ grid = \begin{matrix} [[1, 0, 0], \\ [0, 0, 0], \\ [0, 0, 1]] \end{matrix} $$ ### Options 1. 1 Incorrect ---------------------------- 2. 0 Incorrect ---------------------------- 3. 2 Correct Cell 1s located at the top left and bottom right of the grid cannot be connected. Therefore, both of them form an island on their own, making a total of two islands. ---------------------------- 4. 3 Incorrect ---------------------------- --------------------------------------------- ## Question 2 What is the output if the following grid is given as input? $$ grid = \begin{matrix} [[1, 1, 1], \\ [1, 1, 1], \\ [1, 1, 1]] \end{matrix} $$ ### Options 1. 1 Correct The grid is composed of all cell 1s, which form one island. ---------------------------- 2. 0 Incorrect ---------------------------- 3. 9 Incorrect ---------------------------- 4. 3 Incorrect ---------------------------- --------------------------------------------- ## Question 3 What is the output if the following grid is given as input? $$ grid = \begin{matrix} [[1, 0, 0], \\ [1, 1, 1], \\ [1, 0, 1]] \end{matrix} $$ ### Options 1. 1 Correct All cell 1s are connected to each other, resulting in only one island. ---------------------------- 2. 5 Incorrect ---------------------------- 3. 4 Incorrect ---------------------------- 4. 3 Incorrect ---------------------------- ---------------------------------------------