328. Odd Even Linked List
Odd Even Linked List - LeetCode 단일 연결 리스트의 헤드가 주어졌을 때, 홀수 인덱스 노드를 모두 모아서 그 다음에 짝수 인덱스 노드를 따르도록 리스트를 재정렬하고 결과 리스트를 반환하세요. 첫 번째 노드는 홀수로 간주되고, 두 번째 노드는 짝수로 간주되며, 이러한 순서로 계속됩니다. 홀수 그룹 및 짝수 그룹 내부에서의 상대적인 순서는 입력과 동일하게 유지되어야 합니다. Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list. The first node is..
LeetCode
2023. 11. 18. 21:20