Goal:
Given an array of non-negative integers, find the lexicographically next permutation. If no such permutation, return the ascending order permutation. Intuition:
1. Notice that non-increasing sequence does not have next greater permutation, and non-decreasing sequence is the smallest permutation.
2. …