public static void func(int[] array) {
int left = 0;
int right = array.length-1;
while (left < right) {
while (left < right && array[left]%2 != 0) {
left++;
}
while (left < right && array[right]%2 == 0) {
right--;
}
int tmp = array[left];
array[left] = array[right];
array[right] = tmp;
}
}