일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Custom View
- email regex
- LeetCode 1
- hugging
- imageView shadow
- Swift
- 비동기
- 리액터킷
- ios
- 코코아팟
- 코코아팟 만들기
- UINavigationController
- 커스텀 뷰
- priority
- Delegate Pattern
- 델레게이트
- viewAppear
- ReactorKit
- autoLayout
- Remote Url
- Cocoapods
- DispatchQueue
- CornerRadius
- 뷰 커스텀
- Swift Package Manager
- Two Sum
- onAppear
- 라이브러리
- compression resistance
- view modifier
- 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..