题目描述:import Foundation class For17Solution { func mergeListNode(_ head1: ListNode?,_ head2: ListNode?) -> ListNode? { if head1 == nil { return head2 } ...
题目描述:链表中倒数第 K 个结点。import Foundation class For15Solution { func reversedK(_ head: ListNode?,_ k: Int) -> ListNode? { guard head != nil && k != 0 else { r...
题目描述:1->2->3->4,4->3->2->1import Foundation class For16Solution { func reversedListNode(_ head: ListNode?) -> ListNode? { if head == nil || head?.next == nil { ...
题目描述:调整数组顺序使奇数位于偶数前面。import Foundation class For14Solution { func ReorderOddEven(_ n: [Int]) -> [Int] { var s = n var left = 0 var right = n.count - 1 ...