목록swift 알고리즘/심화 2 (5)
쥐수의 공부노트

정답 : let n = Int(readLine()!)! var array : [Int] = [] var sum = 0 var dict = [Int:Int]() for _ in 0.. 1 { print(mode[1]) } else { print(mode[0]) } let range = array.max()! - array.min()! print(range) 더보기 TMI : Dictionary를 이용해서 최빈값을 구하는 과정을 보자..
swift 알고리즘/심화 2
2023. 6. 5. 15:19

첫번째 풀이 : let n = Int(readLine()!)! var array : [String] = [] var check = false var member = Set() for _ in 0..
swift 알고리즘/심화 2
2023. 6. 5. 14:45

정답 : let n = Int(readLine()!)! var array = Set() var num = 0 var count = 0 for _ in 0..
swift 알고리즘/심화 2
2023. 6. 5. 14:24

정답 : let n = Int(readLine()!)! let input = readLine()!.split(separator: " ").map{Int($0)!}.sorted() var result = 0 if input.count == 1 { result = input[0] * input[0] } else { result = input[0] * input[input.count-1] } print(result) 더보기 TMI : 모든 코딩테스트 문제가 브론즈 단계였으면 좋겠다..
swift 알고리즘/심화 2
2023. 6. 3. 20:48