Bloomberg interview question

Coding problem: Next Permutation on Leetcode