Very easy two pointer solution in java for Beginners
\nclass Solution {\n    public int[] sortArrayByParityII(int[] nums) {\n        int even = 0 ;\n        int odd =  1 ;\n        \n        while(even < nums.leng
```\nclass Solution {\n    public int[] sortArrayByParityII(int[] nums) {\n        int even = 0 ;\n        int odd =  1 ;\n        \n        while(even < nums.length && odd < nums.length){\n            \n            if(nums[even]%2 != 0){\n                swap(nums , even , odd);\n                odd += 2 ;\n            } else{\n                even += 2 ;\n            }\n        }\n        \n        return nums ;\n    }\n    \n    public void swap(int[] arr , int e1 , int e2){\n        int temp = arr[e1];\n        arr[e1] = arr[e2];\n        arr[e2] = temp ;\n    }\n}\n```
['Two Pointers', 'Java']