https://school.programmers.co.kr/learn/courses/30/lessons/132267 테스트 케이스는 통과하는데 제출시 우르르 실패로 떠서 뭐지(?) 싶었다.그런데 역시 내가 문제였고.. 문제를 잘 읽어봤어야 했다.. 처음 제출했던 답은 아래와 같다func solution(_ a:Int, _ b:Int, _ n:Int) -> Int { var currentCola: Int = n var result: Int = 0 while currentCola >= a { currentCola -= a result += 1 // 빈병을 반납하면 콜라 한병을 받는거로 구했음 currentCola += b } re..
알고리즘
2024. 7. 26. 14:59
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- ios
- Swift 알고리즘
- removeLast()
- RIBs tutorial
- swift programmers
- Swift inout
- swift (programmers)
- Swift ModernRIBs
- Combine: Asynchronous Programming with Swift
- swift property
- 2023년 회고
- swift reduce
- RTCCameraVideoCapturer
- Swift 프로퍼티
- swift protocol
- iOS error
- Swift RIBs
- Swift Error Handling
- Swift
- Swift joined()
- Swift 내림차순
- Swift joined
- swift 고차함수
- CS 네트워크
- Swift init
- 원티드 프리온보딩
- Class
- Swift final
- Swift Leetcode
- Swift 프로그래머스
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 29 | 30 | 31 |
글 보관함