import Foundation func merge(_ a: [Int], _ b: [Int]) -> [Int] { var i = 0 var j = 0 var sorted = [Int]() while i < a.count && j < b.count { if a[i] < b[j] { sorted.append(a[i]) i += 1 } else { sorted.append(b[j]) j += 1 } } for n in i.. [Int]{ if a.count > 1 { let middle = a.count / 2 let left = mergeSort(Array(a[0..