Driver code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT str = "4321" NEW_LINE b , str = prevPermutation ( str ) NEW_LINE if ( b == True ) : NEW_LINE INDENT print ( " Previous ▁ permutation ▁ is " , str ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Previous ▁ permutation ▁ doesn ' t ▁ exist " ) NEW_LINE DEDENT DEDENT