diff --git a/alstjr7437/README.md b/alstjr7437/README.md index be196cf5..7dcd819b 100644 --- a/alstjr7437/README.md +++ b/alstjr7437/README.md @@ -30,4 +30,5 @@ | 26차시 | 2024.05.22 | 정렬 | H-Index | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/196 | | 27차시 | 2024.05.26 | 우선순위 큐 | 이중 우선순위 큐 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/198 | | 28차시 | 2024.05.30 | 브루트 포스 | 카잉 달력 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/203 | -| 29차시 | 2024.06.11 | 이분 탐색 | 나무 자르기 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/210 | \ No newline at end of file +| 29차시 | 2024.06.11 | 이분 탐색 | 나무 자르기 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/210 | +| 30차시 | 2024.06.19 | 방 번호 | 구현 | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/211 | \ No newline at end of file diff --git "a/alstjr7437/\352\265\254\355\230\204/\353\260\251\353\262\210\355\230\270.swift" "b/alstjr7437/\352\265\254\355\230\204/\353\260\251\353\262\210\355\230\270.swift" new file mode 100644 index 00000000..35748162 --- /dev/null +++ "b/alstjr7437/\352\265\254\355\230\204/\353\260\251\353\262\210\355\230\270.swift" @@ -0,0 +1,16 @@ +let N : String = readLine()! +var result : [Character:Int] = [:] + +for i in N{ + let temp = (i == "9") ? "6" : i + if result[temp] == nil{ + result[temp] = 1 + } else { + result[temp]! += 1 + } +} +if result["6"] != nil{ + result["6"]! = (result["6"]! + 1) / 2 +} + +print(result.values.max() ?? 0) \ No newline at end of file