public ListNode<Integer> get2(ListNode<Integer> list) {
    validateInput(list);

    ListNode<Integer> currentNode = list;
    ListNode<Integer> fastNode = list.getNext();
    while (fastNode != null && fastNode.getNext() != null) {
      currentNode = currentNode.getNext();
      fastNode = fastNode.getNext().getNext();
    }
    return currentNode;
  }
Iterative solution to this problem. The complexity order of this algorithm in time and space
terms is equivalent to the previous algorithm but the execution time is lower in this version.
The key of this algorithm is based on use two pointers, going going two times faster trough
the
list during the iteration.
src/main/java/com/github/pedrovgs/problem64/GetTheElementInTheMiddleOfTheList.java