public ListNode find2(ListNode listNode, int k) {
    validateInput(listNode, k);

    int size = calculateListSize(listNode);
    if (k > (size - 1)) {
      throw new IndexOutOfBoundsException();
    }
    ListNode result = listNode;
    int n = size - 1 - k;
    while (n > 0) {
      result = result.getNext();
      n--;
    }
    return result;
  }
Another iterative approach based on calculate the list size before to start iterating over the
list to find the Kth element. The complexity order in time and space terms is the same than
the
previous approach.
src/main/java/com/github/pedrovgs/problem58/FindKthElement.java