mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-09 03:34:02 +08:00
修正【0707-设计链表.md】TypeScript代码
This commit is contained in:
@ -973,6 +973,9 @@ class MyLinkedList {
|
|||||||
// 处理头节点
|
// 处理头节点
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
this.head = this.head!.next;
|
this.head = this.head!.next;
|
||||||
|
if (index === this.size - 1) {
|
||||||
|
this.tail = null
|
||||||
|
}
|
||||||
this.size--;
|
this.size--;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user