From 5baec899f63e0059eae8ab4349ba0d2b6408d448 Mon Sep 17 00:00:00 2001 From: songyc macbook Date: Sat, 21 Mar 2026 23:20:06 +0900 Subject: [PATCH] baekjoon 20260321 --- code_study/Baekjoon/swift/2263.swift | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 code_study/Baekjoon/swift/2263.swift diff --git a/code_study/Baekjoon/swift/2263.swift b/code_study/Baekjoon/swift/2263.swift new file mode 100644 index 0000000..2f51876 --- /dev/null +++ b/code_study/Baekjoon/swift/2263.swift @@ -0,0 +1,40 @@ +func main() { + guard let n = Int(readLine() ?? "") else { return } + guard let line1 = readLine(), + let line2 = readLine() + else { return } + + let inOrder = line1.split(separator: " ").compactMap{Int($0)} + let postOrder = line2.split(separator: " ").compactMap{Int($0)} + + var inOrderIdx = Array(repeating: -1, count: n+1) + + for i in 0..