![](http://i1.daumcdn.net/thumb/C148x148.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/crgprv/btrRoQSTDcF/2C3LNQXBYXov08EwBNwt80/img.png)
https://school.programmers.co.kr/learn/courses/30/lessons/120892 문제 사진 내 풀이 import Foundation func solution(_ cipher:String, _ code:Int) -> String { return (1...cipher.count) // 1 .filter { $0.isMultiple(of: code) } // 2 .map { String(Array(cipher)[$0 - 1]) } // 3 .joined(separator: "") } solution("pfqallllabwaoclk", 2) 1. isMultiple(of:) 메서드로 매개변수 code 만큼의 배수들만 걸러냅니다. print [2, 4, 6, 8, 10, 12,..
알고리즘
2022. 11. 17. 10:02
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- Swift
- swift property
- Swift Leetcode
- Swift init
- CS 네트워크
- Swift final
- Swift 내림차순
- Class
- removeLast()
- Swift joined
- Swift RIBs
- Combine: Asynchronous Programming with Swift
- swift programmers
- Swift 프로그래머스
- swift 고차함수
- 2023년 회고
- RTCCameraVideoCapturer
- Swift ModernRIBs
- 원티드 프리온보딩
- swift (programmers)
- Swift 알고리즘
- swift reduce
- Swift joined()
- Swift 프로퍼티
- RIBs tutorial
- Swift inout
- Swift Error Handling
- ios
- iOS error
- swift protocol
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함