My simple java solution
public class Solution {\n    public ListNode removeNthFromEnd(ListNode head, int n) {\n        ListNode fast = head;\n        ListNode slow = head;\n\t\twhile(f
    public class Solution {\n    public ListNode removeNthFromEnd(ListNode head, int n) {\n        ListNode fast = head;\n        ListNode slow = head;\n\t\twhile(fast != null) {\n\t\t\tfast = fast.next;\n        \tif(n-- < 0) {\n        \t\tslow = slow.next;\n        \t}\n        }\n\t\t\n\t\tif(n == 0) {\n\t\t\thead = head.next;\n\t\t} else if(n < 0) {\n\t\t\tslow.next = slow.next.next;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\treturn head;\n    }\n}
[]