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 | 29 | 30 |
Tags
- 안드로이드
- 프로퍼티
- 연산자
- 해시
- 구조체
- weak
- noncopyable
- 프래그먼트
- 생명주기
- concurrency
- ios
- 차이
- async
- 스위프트
- 옵셔널
- rx
- 알고리즘
- Swift
- 리스트뷰
- 백준
- 클로저
- 이스케이핑
- Self
- 자바
- 프로그래머스
- RxSwift
- 풀이
- View
- observable
- Subject
Archives
- Today
- Total
목록알고리즘/스위프트 알고리즘 (3)
study record
백준 2740 - 스위프트 풀이
import Foundation func BJ2740(){ var arrSizes = readLine()!.split(separator: " ").map{ Int($0)! } var arrA: [[Int]] = Array(repeating: Array(repeating: 0, count: arrSizes[1]), count: arrSizes[0]) for i in 0..
알고리즘/스위프트 알고리즘
2022. 2. 6. 12:58
백준 1292 - 스위프트 풀이
import Foundation func BJ1292(){ let nums = readLine()!.split(separator: " ").map{ Int($0)} var arr: [Int] = [] var count = 1 var n = 1 for _ in 1...1000 { arr.append(n) if count < n { count += 1 }else{ n += 1 count = 1 } } var sum = 0 for i in nums[0]!...nums[1]! { sum += arr[i-1] } print(sum) } func BJ1292plus(){ // 더 깔끔한 풀이 var arr: [Int] = [] for i in 1..
알고리즘/스위프트 알고리즘
2022. 2. 4. 15:54