Update Next Permutation by Kang Huang & Yan Zhao [iteration].java