
https://leetcode.com/explore/learn/card/fun-with-arrays/521/introduction/3240/discuss/234202/Swift-no-brainer 내 풀이 func sortedSquares(_ nums: [Int]) -> [Int] { return nums.map { ($0 * $0) }.sorted() } sortedSquares([-7,-3,2,3,11]) 배운것 sorted(by:) 요소(elements)들 간의 비교로 정렬을 해줍니다. 예제 let numArr = [-7,-3,2,3,11] print(numArr.sorted()) // 오름차순 // [-7, -3, 2, 3, 11] print(numArr.sorted(by: >)) // 내림차순 ..
알고리즘
2022. 5. 20. 10:02
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- swift 고차함수
- Swift final
- Swift Error Handling
- CS 네트워크
- RTCCameraVideoCapturer
- Swift ModernRIBs
- Swift RIBs
- 2023년 회고
- Swift inout
- swift (programmers)
- Swift
- Swift joined
- 원티드 프리온보딩
- Swift 프로그래머스
- removeLast()
- iOS error
- Swift joined()
- RIBs tutorial
- Swift 알고리즘
- swift reduce
- ios
- Swift 내림차순
- Swift init
- Swift Leetcode
- swift protocol
- Swift 프로퍼티
- swift programmers
- Class
- Combine: Asynchronous Programming with Swift
- swift property
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함