Couchbase interview question

LeetCode: 31. Next Permutation (Interviewer focused more on approach rather than actual solution)