Module Expr Str Assign NameStore Str ClassDef bases body FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore BinOpSub NameLoad Num While BoolOpAnd CompareGtE NameLoad Num CompareLtE SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index BinOpAdd NameLoad Num body AugAssignSub NameStore Num If CompareLt NameLoad Num body Return SubscriptLoad NameLoad Slice Num Assign NameStore BinOpSub NameLoad Num While BoolOpAnd CompareGtE NameLoad Num CompareGtE SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad body AugAssignSub NameStore Num Assign TupleStore SubscriptStore NameLoad Index NameLoad SubscriptStore NameLoad Index NameLoad TupleLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign SubscriptStore NameLoad Slice BinOpAdd NameLoad Num Call NameLoad SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num Return NameLoad decorator_list decorator_list If CompareEq NameLoad Str body Print Call AttributeLoad Call NameLoad attr ListLoad Num Num Num Num
N/A N/A 
Given a list of integers, which denote a permutation.

Find the previous permutation in ascending order.

Note
The list may contains duplicate integers.

Example
For [1,3,2,3], the previous permutation is [1,2,3,3]

For [1,2,3,4], the previous permutation is [4,3,2,1]
 N/A __author__ Danyang Solution N/A N/A previousPermuation N/A N/A self num N/A N/A N/A 
        permutation, reverse operation of next permutation
        :param num: a list of integer
        :return: a list of integer
         N/A n N/A len num N/A partition N/A n 2 N/A N/A N/A partition 0 N/A N/A num N/A partition N/A num N/A N/A partition 1 N/A N/A partition 1 N/A N/A partition 0 N/A N/A N/A num N/A -1 N/A change N/A n 1 N/A N/A N/A change 0 N/A N/A num N/A change N/A num N/A partition N/A N/A change 1 N/A N/A N/A num N/A partition N/A num N/A change N/A N/A num N/A change N/A num N/A partition N/A N/A num N/A N/A partition 1 N/A reversed N/A num N/A N/A partition 1 N/A num N/A N/A N/A N/A __name__ __main__ N/A N/A N/A N/A N/A Solution previousPermuation N/A 1 3 2 3