public static void main(String[] args){
        NextPermutation test = new NextPermutation();
        int[] num = {2,3,1};

        for(int i = 0; i < num.length; i++){
            System.out.print(num[i] + " ");
        }
        System.out.println();

        test.nextPermutation(num);
        for(int i = 0; i < num.length; i++){
            System.out.print(num[i] + " ");
        }
    }