Several bugs fixes and improvments;

This commit is contained in:
krahets
2023-10-01 19:33:53 +08:00
parent ddb2f9e024
commit 98538b924f
5 changed files with 16 additions and 11 deletions

View File

@ -8,8 +8,8 @@
* Definition for a singly-linked list node
*/
class ListNode {
val;
next;
val; // 节点值
next; // 指向下一节点的引用(指针)
constructor(val, next) {
this.val = val === undefined ? 0 : val;
this.next = next === undefined ? null : next;