728x90
반응형
Remove Nth Node From End of List
-
[Leet Code] Two Pointers (투포인터): 19.Remove Nth Node From End of List - MediumCS기초/Coding Test 2023. 1. 5. 02:43
문제 / 코드 Description Remove the nth node from the end of the list and return its head. How to solve Since the given linked list can only be traversed from the first to the last node, we need to find a way to calculate where nth node from the end is from the start. However, the length of a linked list is not fixed, how can we find it? Let the length of the given linked list be l. Then the position..