Find index of j such that it is greater than last_index
for it in idx [ j ] : NEW_LINE INDENT if it > last_index : NEW_LINE INDENT last_index = it NEW_LINE temp = True NEW_LINE break NEW_LINE DEDENT DEDENT if ( temp == False ) : NEW_LINE INDENT return False NEW_LINE DEDENT