Doubt in my code

When I give input as given in sample input. It gives me wrong sample output as :

11
1

instead of:

12
1

What is the problem in my code?

Hey @yashsharma4304
Your approach is incorrect,u are not considering the type of cab or rickshaw

Here refer to this solution : https://ide.codingblocks.com/s/360304 :slight_smile:

But I don’t know how to use arrays. Is there any other solution without using arrays?

No you have to consider arrays.
And arrays are quite basic in coding so I suggest u to go do them first and then come back to this problem :slight_smile:

1 Like

Ok So I will first learn arrays then come back here again. Thank you for resolving my doubt. :slightly_smiling_face:

1 Like