Skip to content

Commit

Permalink
boj 1157 - 단어 공부 : 문자열
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuncheonian committed Mar 31, 2022
1 parent 343db4c commit c55a14d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions boj_01157.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// 2022.04.01
// Dongyoung Kwon @Chuncheonian (ehddud2468@gmail.com)
// https://www.acmicpc.net/problem/1157

let str = Dictionary(readLine()!.uppercased().map{ ($0, 1) }, uniquingKeysWith: +)

var result = str.filter{ $0.value == str.values.max() }

print(result.count == 1 ? result.first!.key : "?")

0 comments on commit c55a14d

Please sign in to comment.