Question 19
trains is a list that contains information about trains associated with a station stn. Specifically, each element in this list is a pair: [Arrival, Departure]. If the arrival or departure time is empty, it is represented as "None".
1 flag1 = False, flag2 = True 2 count = 0 3 foreach x in trains{ 4 if(first(x) == "None" or last(x) == "None"){ 5 flag1 = True 6 } 7 else{ 8 count = count + 1 9 }10 }11 if(count == length(trains)){12 flag2 = False13 }Based on the above data, answer the given subquestions.
What does the variable count represent at the end of execution of the given pseudocode?
It is the number of trains associated with stn
It is the number of trains for which stn is a starting station
It is the number of trains for which stn is an ending station
It is the number of trains for which stn is neither a starting nor an ending station