Sainnhe Park
91b8ac05f7
All checks were successful
continuous-integration/drone/push Build is passing
18 lines
379 B
C++
18 lines
379 B
C++
#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
|