Skip to content

Commit 50c7acb

Browse files
committed
fix: CRLF -> LF 로 변경
1 parent 92a6a41 commit 50c7acb

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed
Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
1-
class Solution { public ListNode mergeTwoLists(ListNode list1, ListNode list2) { ListNode dummy = new ListNode(-1); ListNode curr = dummy; while (list1 != null && list2 != null) { if (list1.val <= list2.val) { curr.next = list1; list1 = list1.next; } else { curr.next = list2; list2 = list2.next; } curr = curr.next; } if (list1 != null) { curr.next = list1; } else if (list2 != null) { curr.next = list2; } return dummy.next; }}
1+
class Solution {
2+
public ListNode mergeTwoLists(ListNode list1, ListNode list2) {
3+
ListNode dummy = new ListNode(-1);
4+
ListNode curr = dummy;
5+
6+
while (list1 != null && list2 != null) {
7+
if (list1.val <= list2.val) {
8+
curr.next = list1;
9+
list1 = list1.next;
10+
} else {
11+
curr.next = list2;
12+
list2 = list2.next;
13+
}
14+
curr = curr.next;
15+
}
16+
17+
if (list1 != null) {
18+
curr.next = list1;
19+
} else if (list2 != null) {
20+
curr.next = list2;
21+
}
22+
23+
return dummy.next;
24+
}
25+
}

0 commit comments

Comments
 (0)