public ListNode removeNthFromEnd(ListNode head, int n) {
        if(null == head) return head;
        
        ListNode result = new ListNode(0);
        result.next = head;
        
        int length = getLengthOfList(head);
        int moves = length - n;
        
        ListNode pointer = result;
        int index = 0;
        
        while(index < moves) {
        	pointer = pointer.next;
        	index++;
        }
        
        ListNode temp = pointer.next;
        pointer.next = temp.next;
        temp.next = null;
        
        return result.next;
    }