Count total number of collisions while traversing the string a
i = 0 NEW_LINE while ( i < m and i < n ) : NEW_LINE INDENT if ( a [ i ] == ' T ' ) : NEW_LINE INDENT answer += count_of_truck_in_lane_b NEW_LINE DEDENT if ( b [ i ] == ' T ' ) : NEW_LINE INDENT count_of_truck_in_lane_b -= 1 NEW_LINE DEDENT i += 1 NEW_LINE DEDENT return answer NEW_LINE