public void partitionArray(int[] nums) {
        // write your code here;
        if (nums == null || nums.length <= 1) {
            return;
        }
        int begin = 0, end = nums.length - 1;
        while (begin < end) {
            int val = nums[begin];
            if (val % 2 == 0) {
                while (begin < end && nums[end] % 2 == 0) {
                    --end;
                }
                swap(nums, begin, end--);
            }
            ++begin;
        }
    }