CODING
Day 12: The “Next Permutation” Problem
Published in
3 min readMay 15, 2020
Problem:
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
If such an arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order).