public String[] evaluate(String[] words, String pattern) {
    if (words == null || pattern == null) {
      throw new IllegalArgumentException("You can't pass null objects as input.");
    }
    List<String> result = new ArrayList<String>();
    for (String word : words) {
      if (matchDotRegularExpression(word, pattern)) {
        result.add(word);
      }
    }
    return result.toArray(new String[result.size()]);
  }
Iterative and recursive solution to solve this problem. The complexity order of this algorithm
is O(N*M) where N is the number of elements in the input array and M the complexity order of
the method written below. In space terms the complexity order of this algorithm is O(N) because
we are using an array to keep the result of the problem.
src/main/java/com/github/pedrovgs/problem34/DotRegularExpression.java