Prints all distinct permutations in str [ 0. . n - 1 ]
def findPermutations ( string , index , n ) : NEW_LINE INDENT if index >= n : NEW_LINE INDENT print ( ' ' . join ( string ) ) NEW_LINE return NEW_LINE DEDENT for i in range ( index , n ) : NEW_LINE DEDENT