simple one pass solution in java | explained | 0ms faster than 100%
```\nclass Solution {\n    public ListNode removeNthFromEnd(ListNode head, int n) {\n        // Create two nodes pointing to head;\n        var first = head;\n 
```\nclass Solution {\n    public ListNode removeNthFromEnd(ListNode head, int n) {\n        // Create two nodes pointing to head;\n        var first = head;\n        var second = head;\n        \n        // make second node n nodes ahead of first node;\n        for (int i =0; i <n; i++)\n            second = second.next;\n        \n        // If second node is null, that mean n == list.size-1;\n        // that means we have to remove the head of the list;\n        if (second == null)\n            return first.next;\n        \n        // if second node is not null, lets move both first and second nodes\n        // until second.next == null;\n        // remember after this, first node will n+1 nodes from the end;\n        while(second.next != null) {\n            first = first.next;\n            second = second.next;\n        }\n        \n        // we can easily skip nth node and make first.next point to n.next;\n        first.next = first.next.next;\n        \n        return head;\n    }\n}
['Java']