Count total number of collisions while traversing the String a
for ( let i = 0 ; i < n && i < m ; i ++ ) { if ( a [ i ] == ' ' ) answer += count_of_truck_in_lane_b ; if ( b [ i ] == ' ' ) count_of_truck_in_lane_b -- ; } return answer ; }