BOJ-1920

    [백준 BOJ] BOJ-1920 수 찾기

    #1920 수 찾기 문제 정리 풀이 import Foundation let n: Int = Int(readLine()!)! let numList: Set = Set(readLine()!.split(separator: " ").map { Int($0)! }) let m: Int = Int(readLine()!)! let findList: [Int] = readLine()!.split(separator: " ").map { Int($0)! } findList.forEach { print(numList.contains($0) ? 1 : 0) } set.contains() 를 활용하여 값이 numList에 들어있는지 비교 시간복잡도는 O(n) 풀고나서 알게된 것