Stores the resulting subsequences
S1 = " " NEW_LINE S2 = " " NEW_LINE for i in range ( n ) : NEW_LINE INDENT if ( res [ i ] == '1' ) : NEW_LINE INDENT S1 += str [ i ] NEW_LINE DEDENT else : NEW_LINE INDENT S2 += str [ i ] NEW_LINE DEDENT DEDENT