力扣小白刷題之19題刪除鏈表的倒數第N個節點

題目描述 給定一個鏈表,刪除鏈表的倒數第 n 個節點,並且返回鏈表的頭結點。 思路:雙指針(+預先指針) 參考自:https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/solution/hua-jie-suan-fa-19-shan-chu-lian-biao-de-dao-shu-d/ 整體思路是讓前面的指針先移動 n
相關文章
相關標籤/搜索