class MoveZerosInArray {

  public void moveUsingTwoPointers(int[] array) {
    validateArray(array);

    int left = 0;
    int right = array.length - 1;
    while (left < right) {
      if (array[left] == 0 && array[right] != 0) {
        swap(array, left, right);
      }
      if (array[left] != 0) {
        left++;
      }
      if (array[right] == 0) {
        right--;
      }
    }
  }

}