public ListNode removeNthFromEnd(ListNode head, int n) {
		if(head == null) return null;
		int k = 0;
		ListNode cur = head, pre = head;
		
		while(k < n){
			cur = cur.next;
			k++;
		}
		
		if(cur == null) head = head.next;
		else {
			cur = cur.next;
			while(cur != null){
				cur = cur.next;
				pre = pre.next;
			}
			pre.next = pre.next.next;
		}
		return head;
	}