結果 : how does next permutation work