C# solution for Leetcode question: Remove Nth Node From End of List(difficulty : easy)

Jiajionline
Aug 8, 2017 · 1 min read

Source:

Given a linked list, remove the nth node from the end of list and return its head.

For example,

Given linked list: 1->2->3->4->5, and n = 2.   After removing the second node from the end, the linked list becomes 1->2->3->5.

Note:
Given n will always be valid.
Try to do this in one pass.

My C# solution is here:

https://github.com/jiajionline/LeetcodeSolutionWithMultipleLanguages/tree/master/Remove%20Nth%20Node%20From%20End%20of%20List

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade