storing sub in map
if len ( sub ) in sorted_subsequence . keys ( ) : NEW_LINE INDENT sorted_subsequence [ len ( sub ) ] = tuple ( list ( sorted_subsequence [ len ( sub ) ] ) + [ sub ] ) NEW_LINE DEDENT else : NEW_LINE INDENT sorted_subsequence [ len ( sub ) ] = [ sub ] NEW_LINE DEDENT for it in sorted_subsequence : NEW_LINE