nextPermutation should work with static arrays too.