A boy is asked to put in a basket one mango when ordered 'One', one orange when ordered 'Two', one apple when ordered 'Three' and is asked to take out from the basket one mango and orange when ordered 'Four'. A sequence of orders is given as 12332142314223314113234 . How many total fruits will be in the basket at the end of above order sequence?
Orders:
Sequence: 12332142314223314113234
Letβs track the counts for (Mangoes, Oranges, Apples) through the sequence:
Start: (M=0, O=0, A=0)
1 → +M → (1,0,0)
2 → +O → (1,1,0)
3 → +A → (1,1,1)
3 → +A → (1,1,2)
2 → +O → (1,2,2)
1 → +M → (2,2,2)
4 → -(M,O) → (1,1,2)
2 → +O → (1,2,2)
3 → +A → (1,2,3)
1 → +M → (2,2,3)
4 → -(M,O) → (1,1,3)
2 → +O → (1,2,3)
2 → +O → (1,3,3)
3 → +A → (1,3,4)
3 → +A → (1,3,5)
1 → +M → (2,3,5)
4 → -(M,O) → (1,2,5)
1 → +M → (2,2,5)
1 → +M → (3,2,5)
3 → +A → (3,2,6)
2 → +O → (3,3,6)
3 → +A → (3,3,7)
4 → -(M,O) → (2,2,7)
At the end of the sequence, the basket contains:
Total Fruits = 2 + 2 + 7 = 11
Final Answer: 11
Reinforce your conceptual grasp with related questions from NIMCET 2016:
How many pairs of the letters are there in the word "NECESSARY" which...
A, B, C, D, E, F and G are members of a family consisting of four...
Take timed full-length mock tests with authentic question distributions, negative marking (+12/-3 in Math), and instant All India Rank calculation.
Start Free Mock Test Series β