[Programmers] 튜플 Swift
프로그래머스 튜플 Swift 내 풀이 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 import Foundation func solution(_ s:String) -> [Int] { var dic = [Int:Int]() var result = [Int]() var input = s.replacingOccurrences(of: "{", with: "") input = input.replacingOccurrences(of: "}", with: "") var data = input.split{$0 == ","}.map{Int(String($0))!} for i in data { if dic[i] != nil { dic[i]! += 1 } else { dic[i] ..
2023.06.19