Skip to content

Commit 3164f3c

Browse files
committed
leetcode
1 parent ea9f325 commit 3164f3c

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

OddEvenLinkedList/odd_even_linked_list.go

-35
Original file line numberDiff line numberDiff line change
@@ -33,41 +33,6 @@ func oddEvenList(head *ListNode) *ListNode {
3333
return oddList.Next
3434
}
3535

36-
/*
37-
38-
39-
ListNode? oddEvenList(ListNode? head) {
40-
if (head == null || head.next == null) {
41-
return head;
42-
}
43-
44-
ListNode? evenList = ListNode(-1);
45-
ListNode? oddList = ListNode(-1);
46-
47-
ListNode? currentEven = evenList;
48-
ListNode? currentOdd = oddList;
49-
50-
ListNode? current = head;
51-
int i = 1;
52-
while (current != null) {
53-
if (i % 2 != 0) {
54-
currentOdd?.next = current;
55-
currentOdd = current;
56-
current = current.next;
57-
} else {
58-
currentEven?.next = current;
59-
currentEven = current;
60-
current = current.next;
61-
}
62-
i++;
63-
}
64-
currentOdd?.next = evenList.next;
65-
currentEven?.next = null;
66-
return oddList.next;
67-
}
68-
69-
*/
70-
7136
// func oddEvenList(head *ListNode) *ListNode {
7237
// if head == nil {
7338
// return head

0 commit comments

Comments
 (0)