본문 바로가기 메뉴 바로가기

Peppo

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

Peppo

검색하기 폼
  • 분류 전체보기 (222)
    • Story (13)
    • iOS (144)
      • Error (11)
    • 알고리즘 (43)
    • ETC (7)
    • React-Native (0)
    • CS (Computer science) (3)
  • 방명록

Swift zip (1)
[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
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
  • Peppo's Github
TAG
  • removeLast()
  • Swift init
  • swift protocol
  • iOS error
  • Class
  • Swift Leetcode
  • RTCCameraVideoCapturer
  • Swift final
  • Swift Error Handling
  • ios
  • swift (programmers)
  • swift programmers
  • Swift joined
  • Swift 프로퍼티
  • Swift inout
  • 2023년 회고
  • 원티드 프리온보딩
  • Swift ModernRIBs
  • Swift joined()
  • Swift 알고리즘
  • Swift 내림차순
  • swift property
  • swift reduce
  • Swift 프로그래머스
  • RIBs tutorial
  • CS 네트워크
  • Combine: Asynchronous Programming with Swift
  • Swift RIBs
  • swift 고차함수
  • Swift
more
«   2026/05   »
일 월 화 수 목 금 토
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
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바