| Pregunta | Respuesta |
| Remove Nth Node From End of List | public ListNode removeNthFromEnd(ListNode head, int n) { ListNode first = new ListNode(0); first.next = head; ListNode fast = first, slow = first; while(fast.next != null){ fast = fast.next; if(n-- < 1 ) slow = slow.next; } slow.next = slow.next.next; return first.next; } |
¿Quieres crear tus propias Fichas gratiscon GoConqr? Más información.