nextPermutation2 = function(nums) {
  const current = parseInt(nums.join(''), 10);
  const max = Math.pow(10, nums.length);

  for(let next = current + 1; next < max; next++) {
    if(isPermutation(nums, next)) {
      setNumbersInArray(nums, next);
      return;
    }
  }
}
Runtime O(10^n)
https://leetcode.com/problems/next-permutation/
@param {number[]} nums
@return {void} Do not return anything, modify nums in-place instead.