https://dev.to/christina_sharons_2b3205/next-permutation-explained-step-by-step-47oc