Code first, followed by explaination.
class Solution {
public:
ListNode* removeNthFromEnd(ListNode* head, int& n) {
auto node = new ListNode(0);
node>next = head;
removeNode(node, n);
return node>next;
}
void removeNode(ListNode* head, int& n){
if(!head) return;
removeNode(head>next, n);
n;
if(n == 1) {
head>next = head>next>next;
}
return;
}
};
 The intuitive way :
 count the number of node ( N ) .
 get the (Nn)th node from beginning.
This approach will go through the list for exact 2 loops.

My version of implementation is to do the counting and deleting in "basically" 1 loop.

The trick is
int& n
. When recursively going through the list, the samen
will pass down the recursion because&
sign means passing the reference down. 
When reach the end of the list.
n
start to decrement. Whenn
hits1
, that means we are at (n+1)th node from the end, then we can do the deletion.
This solution was definitely inspired by someone else on some other problem. But I can't seems to find that problem or person. Thanks to whoever inspired me.