[Swift 알고리즘] - 내적 (Programmers)
https://school.programmers.co.kr/learn/courses/30/lessons/70128 내 풀이 import Foundation func solution(_ a:[Int], _ b:[Int]) -> Int { var saveArr: [Int] = [] for (idx, num) in b.enumerated() { saveArr.append(num * a[idx]) } let result: Int = saveArr.reduce(0, { $0 + $1}) return result } solution([1,2,3,4], [-3,-1,0,2]) 다른사람의 풀이 func solution(_ a:[Int], _ b:[Int]) -> Int { let result = zip(a, b).ma..
알고리즘
2022. 10. 10. 13:00
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- Swift Leetcode
- Swift joined()
- Swift 내림차순
- Swift inout
- Swift Error Handling
- swift programmers
- Swift 프로퍼티
- Swift 알고리즘
- Combine: Asynchronous Programming with Swift
- Swift joined
- RIBs tutorial
- Class
- ios
- swift 고차함수
- Swift 프로그래머스
- Swift final
- swift protocol
- 2023년 회고
- swift property
- Swift RIBs
- swift reduce
- Swift
- Swift init
- removeLast()
- CS 네트워크
- Swift ModernRIBs
- RTCCameraVideoCapturer
- iOS error
- swift (programmers)
- 원티드 프리온보딩
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함