摘要: 题目描述 给你单链表的头指针head和两个整数left和right,其中 left<=right。请你反转从位置left到位置right的链表节点,返回反转后的链表。 题目链接 https://leetcode-cn.com/problems/reverse-linked-list-ii/descr 阅读全文
posted @ 2021-12-14 21:57 jsqup 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 题目描述 给定单链表的头节点head,请你反转链表,并返回反转后的链表. 原题链接 https://leetcode-cn.com/problems/reverse-linked-list/description/ 样例 输入:head = [1,2,3,4,5] 输出:[5,4,3,2,1] 输入 阅读全文
posted @ 2021-12-14 21:43 jsqup 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 题目描述 存在一个按升序排列的链表,给你这个链表的头节点head,请你删除所有重复的元素,使每个元素只出现一次。 返回同样按升序排列的结果链表。 原题链接 https://leetcode-cn.com/problems/remove-duplicates-from-sorted-list/desc 阅读全文
posted @ 2021-12-14 21:22 jsqup 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 题目描述 给定一个链表,删除链表的倒数第 nn 个节点,并且返回链表的头结点。 原题链接 https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/description/?utm_source=LCUS&utm_medium 阅读全文
posted @ 2021-12-14 20:29 jsqup 阅读(216) 评论(0) 推荐(0) 编辑