Question: Question 2 : ( 3 0 Marks ) Ahmed is experimenting with dominoes of varying heights. He arranges them in a line, each centered at

Question 2: (30 Marks) Ahmed is experimenting with dominoes of varying heights. He arranges them in a line, each centered at a specific coordinate. When a domino is pushed to the right, it may cause other dominoes to fall if it touches one strictly above its base.
Examples:
Test case 1:
"4
165
205
1010
182"
output : 3141
Explain : It means that if we push to the right the domino in x-coordination 16,3 dominos will fall including itself, and so on.
test case 2 :
"4
010
15
910
1510"
output : 4121
Explain:
It means that if we push to the right the domino in x-coordination 0,4 dominos will fall including itself, and so on.
Develop a python code to implement your algorithm.
subject is : data structures and algo

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!