s0019
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-11-04 16:56:13 +08:00
parent 1de1398897
commit 91b8ac05f7
2 changed files with 45 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
#ifndef S0019_REMOVE_NTH_NODE_FROM_END_OF_LIST
#define S0019_REMOVE_NTH_NODE_FROM_END_OF_LIST
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) {}
};
class Solution {
public:
ListNode* removeNthFromEnd(ListNode* head, int n);
};
#endif