Question
In the array shown below, each cell of the first three rows has either a cross (X) or a number.
The number in a cell represents the count of the immediate neighboring cells (left, right, top, bottom, diagonals) NOT having a cross (X). Given that the last row has no crosses (X), the sum of the four numbers to be filled in the last row is
Official answer and solution
- Official answer
- A
- From
- Official GATE 2024 answer key
Solution
For each of the 4 cells in Row 4, count its adjacent cells in Row 3 and Row 4 that do not contain an 'X'.
Since Row 4 has no crosses (X), all 4 cells in Row 4 are non-X cells. In Row 3, the cells are [3, X, 6, X], so columns 1 and 3 contain numbers (3 and 6), while columns 2 and 4 contain X. Counting the non-X neighbors for each cell in Row 4:
- Cell (4, 1): neighbors are
(3, 1)=3,(3, 2)=X, and(4, 2). Non-X neighbors . - Cell (4, 2): neighbors are
(3, 1)=3,(3, 2)=X,(3, 3)=6,(4, 1), and(4, 3). Non-X neighbors . - Cell (4, 3): neighbors are
(3, 2)=X,(3, 3)=6,(3, 4)=X,(4, 2), and(4, 4). Non-X neighbors . - Cell (4, 4): neighbors are
(3, 3)=6,(3, 4)=X, and(4, 3). Non-X neighbors .
Therefore, the four numbers in the last row are , and their sum is .
Option (A)
Counting the neighbors that HAVE a cross (X) instead of the neighbors NOT having a cross.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2024 Computer Science and Information Technology - Set 2 (CS2)
- Question
- 10 of 65
- Section
- General Aptitude
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.