Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
Tags
- coordinator
- DP
- swift concurrency
- scene delegate
- swift opaque type
- swift bottomsheet
- swift navigationcontroller
- swift 백준
- swift custom ui
- task cancel
- swift dashed line
- OAtuh 2.0
- 버튼 피드백
- swift 점선
- task cancellation
- uikit toast
- custom ui
- 드롭다운 버튼
- swift associated type
- custombottomsheet
- reactorkit
- swift existential type
- SWIFT
- identifiable
- custom navigation bar
- UIKit
- button configuration
- BFS
- Tuist
- RxSwift
Archives
- Today
- Total
김경록의 앱 개발 여정
[Swift 백준] 1475 방 번호 본문

https://www.acmicpc.net/problem/1475
import Foundation
let input = readLine()!
var arr = Array(repeating: 0, count: 10)
for char in input {
if let num = Int(String(char)) {
arr[num] += 1
}
}
// 6에 몰아넣음, 홀수여도 올림을 해야해서 + 1
arr[6] = (arr[6] + arr[9] + 1) / 2
arr[9] = 0
print(arr.max()!)
'Algorithm' 카테고리의 다른 글
| [Swift 백준] 1269 대칭 차집합 (0) | 2025.04.10 |
|---|---|
| [Swift 백준] 11052 카드 구매하기 (0) | 2025.04.03 |
| [Swift 백준] 9465 스티커 (0) | 2025.03.28 |
| [Swift 백준] 7569 토마토 (0) | 2025.03.26 |
| [Swift 백준] 1303 전쟁 - 전투 (0) | 2025.03.25 |