leetcode/include/s0019_remove_nth_node_from_end_of_list.hpp
Sainnhe Park 91b8ac05f7
All checks were successful
continuous-integration/drone/push Build is passing
s0019
2022-11-04 16:56:13 +08:00

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