diff --git a/code_study/Baekjoon/swift/1026.swift b/code_study/Baekjoon/swift/1026.swift new file mode 100644 index 0000000..c03c1c3 --- /dev/null +++ b/code_study/Baekjoon/swift/1026.swift @@ -0,0 +1,16 @@ +if let N = Int(readLine() ?? ""), + let input1 = readLine(), let input2 = readLine(), + let A = input1.split(separator: " ").compactMap({Int($0)}) as? [Int], + let B = input2.split(separator: " ").compactMap({Int($0)}) as? [Int], + A.count == N, B.count == N +{ + let sortedA = A.sorted() + let sortedB = B.sorted(by: >) + + var result: Int = 0 + for i in 0..