Loop to iterate over the intervals with their start time
for i in range ( n ) : NEW_LINE INDENT if interval [ i ] [ 0 ] >= firstEndTime : NEW_LINE INDENT firstEndTime = interval [ i ] [ 1 ] NEW_LINE interval [ i ] . append ( ' S ' ) NEW_LINE DEDENT elif interval [ i ] [ 0 ] >= secondEndTime : NEW_LINE INDENT secondEndTime = interval [ i ] [ 1 ] NEW_LINE interval [ i ] . append ( ' F ' ) NEW_LINE DEDENT else : NEW_LINE INDENT flag = True NEW_LINE break NEW_LINE DEDENT DEDENT