## Question 1 What is the output if the following array of heights is given as input? heights = [1, 2, 5, 7, 3, 9] ```shell |-| |-| |-| |-| |-| |-| |-|-| |-| |-|-| |-| |-|-|-|-| |-|-|-|-|-| |-|-|-|-|-|-| 1 2 5 7 3 9 ``` ### Options 1. 21 Incorrect ---------------------------- 2. 27 Incorrect ---------------------------- 3. 10 Incorrect ---------------------------- 4. 12 Correct height = $3$\ width = $4$\ The area of the largest rectangle will be $3 \times 4 = 12$. ---------------------------- --------------------------------------------- ## Question 2 What is the output if the following array of heights is given as input? heights = [2, 5, 3, 6, 7, 7, 5] ```shell |-|-| |-|-|-| |-| |-|-|-|-| |-| |-|-|-|-| |-|-|-|-|-|-| |-|-|-|-|-|-|-| |-|-|-|-|-|-|-| 2 5 3 6 7 7 5 ``` ### Options 1. 20 Correct height = $5$\ width = $4$\ The area of the largest rectangle will be $5 \times 4 = 20$. ---------------------------- 2. 14 Incorrect ---------------------------- 3. 25 Incorrect ---------------------------- 4. 18 Incorrect ---------------------------- --------------------------------------------- ## Question 3 What is the output if the following array of heights is given as input? heights = [4, 1, 9, 2] ```shell |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-|-| |-|-|-|-| 4 1 9 2 ``` ### Options 1. 18 Incorrect ---------------------------- 2. 16 Incorrect ---------------------------- 3. 9 Correct height = $9$\ width = $1$\ The area of the largest rectangle will be $9 \times 1 = 9$. ---------------------------- 4. 24 Incorrect ---------------------------- ---------------------------------------------