Help ramu without using array

Can this problem be solved without using array

hey @Ajitverma1503, you need to store the number of times Ramu is going to use the rickshaw number and the number of times Ramu is going to use the cab number in the array. For finding result to can do without array.