[Swift] 백준1181
·
📝 코테/BOJ
import Foundation let n = Int(readLine()!)! var arr = [String]() for _ in 0 ..< n { let input = readLine()! arr.append(input) } // 중복제거 arr = Array(Set(arr)) // 길이사전순 + 짧은 순 arr = arr.sorted(by: { $0 < $1 }).sorted(by: { $0.count < $1.count }) for string in arr { print(string) }