If this activity has start time greater than or equal to the finish time of previously selected activity , then select it
if arr [ j ] [ 0 ] >= arr [ i ] [ 1 ] : NEW_LINE INDENT selected . append ( arr [ j ] ) NEW_LINE i = j NEW_LINE DEDENT return selected NEW_LINE