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--;
      }
    }
  }
Second implementation for this problem. This implementation is better than the previous one
because we have reduced the complexity order of this algorithm in time terms from O(N^2) to
O(N). The complexity order in space terms is the same.
src/main/java/com/github/pedrovgs/problem12/MoveZerosInArray.java