일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- imageView shadow
- Remote Url
- 코코아팟
- ReactorKit
- LeetCode 1
- 리액터킷
- compression resistance
- Custom View
- Cocoapods
- autoLayout
- hugging
- viewAppear
- 뷰 커스텀
- Swift
- email regex
- onAppear
- view modifier
- 비동기
- Two Sum
- Delegate Pattern
- UINavigationController
- DispatchQueue
- priority
- 델레게이트
- 코코아팟 만들기
- 커스텀 뷰
- Swift Package Manager
- ios
- CornerRadius
- 라이브러리
- Today
- Total
목록전체 글 (26)
Tong's Blog
문제의 링크는 https://leetcode.com/problems/sort-colors/ 이다. Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively. Note: You are not suppose to use the library's sort function for th..
우선 문제의 링크는 https://leetcode.com/problems/reverse-integer/ 이다. 단순히 주어진 숫자를 거꾸로 뒤집는 문제인데 처음에 int를 초과하는 input이 주어져서 여러번 틀렸다. 첫번째 시도로는 단순히 각자리수를 추출하여 배열로 만들고 다시 자리수를 늘려가며 곱해주는 방식을 취했다. 결과적으로 속도는 0ms로 빠른 편이였지만 코드의 가독성과 불필요한 부분을 생각하면 좋지 못한 코드였다. class Solution { public: int reverse(int x) { long result = 0; int temp = x; vector intVec; while(temp / 10 != 0){ intVec.push_back(temp%10); temp /= 10; } in..