Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... Note: n is positive and will fit within the range of a 32-bit signed integer (n < 231).
题目描述 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
题目链接:https://leetcode.com/problems/remove-nth-node-from-end-of-list/ 这个题目竟然是medium,怕是个easy吧。要求删除链表中倒数第n个节点。 首先想到的就是直接找的待删除节点的前驱结点在执行删除操作就行,这里要注意的是待删除节点可能是头结点的特殊情况,所以用一个虚拟节点来规避,代码如下: class Solution
题目描述 Given a linked list, remove the n-th node from the end of list and return its head. Example: Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the link
Given a linked list, remove the n-th node from the end of list and return its head. Example: Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the linked list