How many 2's are there in the following number sequence, each of which is…
2023
How many 2's are there in the following number sequence, each of which is preceeded and succeeded by '1'? 1 2 1 1 2 1 2 2 1 1 2 1 2 1 1 2 1 2 2 1
- A.
4
- B.
3
- C.
5
- D.
2
Attempted by 327 students.
Show answer & explanation
Correct answer: C
Answer: 5 — There are five 2's each preceded and succeeded by 1.
Method: Scan the sequence left to right and for every 2 check the number immediately before and after it; count it only if both are 1.
Position 2: 1 2 1
Position 5: 1 2 1
Position 11: 1 2 1
Position 13: 1 2 1
Position 16: 1 2 1
Therefore the total number of 2's with a 1 immediately before and after is 5.
A video solution is available for this question — log in and enroll to watch it.