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..