摘要: class Solution { public: int numComponents(ListNode* head, vector<int>& G) { unordered_set<int> s(G.begin(),G.end()); ListNode *node=head; int re=0; w 阅读全文
posted @ 2020-04-10 09:57 qiujiejie 阅读(90) 评论(0) 推荐(0)
摘要: 1. len/k=a...b,共k个part,每个part有a个节点,余下的b的节点,从第一个节点开始,每个节点多加一个。 class Solution { public: vector<ListNode*> splitListToParts(ListNode* root, int k) { vec 阅读全文
posted @ 2020-04-10 09:35 qiujiejie 阅读(130) 评论(0) 推荐(0)