LeetCode 31. Next Permutation https://leetcode.com/problems/next-permutation/
In this problem we need to generate the next lexicographical order for the specified array of numbers.
If you are interested in my comments I invite you to visit the following blog in my post:
https://www.johncanessa.com/2021/01/25/next-permutation/
Keep in mind that one of th ebest ways to learn is to read and experiment.
Enjoy;
John