LeetCode Biweekly Contest 40
問題文
省略
省略
C++に変換後のコードはこちら
#define main dummy_main
{}
#undef main
#define ListNode dummy_ListNode
struct ListNode {};
#undef ListNode
class Solution {
public:
ListNode* mergeInBetween(ListNode* list1, int a, int b, ListNode* list2) {
ListNode *aa, *bb, *st, *ed;
st = ed = list2;
while(ed->next != NULL) ed = ed->next;
aa = bb = list1;
rep(a-1) aa = aa->next;
rep(b+1) bb = bb->next;
aa->next = st;
ed->next = bb;
return list1;
}
};
Current time: 2024年04月20日20時44分52秒
Last modified: 2020年12月06日03時03分17秒 (by laycrs)
Tags: Competitive_Programming_Incomplete LeetCode
トップページに戻る
Logged in as: unknown user (not login)