Given a linked list, remove the nth node from the end of list and return its head.
package pack;
class ListNode {
int val;
ListNode next;
ListNode(int x) { val = x; }
}
class Solution {
public int listlen(ListNode head) {
ListNode p = head;
int len = 1;
while(p.next != null) {
len++;
p = p.next;
}