swift 백준 10818
let repeatNum = Int(readLine()!)! let numArr = readLine()!.split(separator: " ").map{ Int($0)! } var maxNum: Int = 1 var minNum: Int = 1000000 for num in numArr { if num > maxNum { maxNum = num } if num < minNum { minNum = num } } print("\(minNum) \(maxNum)") 이렇게 하니 시간초과가 나왔다 let repeatNum = Int(readLine()!)! let numArr = readLine()!.split(separator: " ").map{ Int($0)! } print("\(numArr.min()!) ..
Algorithm
2020. 12. 28. 09:36