From 8d2b68a134c5b4cfa571ba6f146137b8216728da Mon Sep 17 00:00:00 2001 From: songyc macbook Date: Tue, 23 Sep 2025 21:49:29 +0900 Subject: [PATCH] 20250923 baekjoon --- code_study/Baekjoon/swift/1026.swift | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 code_study/Baekjoon/swift/1026.swift 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..