This commit is contained in:
2025-09-15 21:12:04 +08:00
commit 3f58f483ff
144 changed files with 5298 additions and 0 deletions

33
23/11/Q876.h Normal file
View File

@@ -0,0 +1,33 @@
//
// Created by 李洋 on 2023/11/7.
//
#ifndef LEECODE_C_Q876_H
#define LEECODE_C_Q876_H
#include <vector>
#include <stack>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
ListNode *middleNode(ListNode *head) {
ListNode *slow = head, *fast = head;
while (fast && fast->next) {
slow = slow->next;
fast = fast->next->next;
}
return slow;
}
#endif //LEECODE_C_Q876_H