private void validateInput(char[] input) {
    if (input == null) {
      throw new IllegalArgumentException("You can't pass a null array as input parameter.");
    }
  }
Iterative solution with a better performance in spce terms. In time terms, the complexity
order of this algorithm is still O(N), the execution time is 2N. In space terms, the
complexity order of this algorithm is now O(1) because we are not using any additional data
structure to keep a copy of the input array as we are doing in the previous solution.
src/main/java/com/github/pedrovgs/problem52/ReplaceSpaces.java