์ ์ฒด ๊ธ
-
ReactorKit์ผ๋ก ๊ณ์ฐ๊ธฐ ๊ตฌํํ๊ธฐSwift 2021. 7. 5. 21:48
์๋ ํ์ธ์. ๊ทธ๋ฆฐ์ ๋๋ค๐ข ์ด๋ฒ ํฌ์คํ ์์๋ ReactorKit์ผ๋ก ๊ณ์ฐ๊ธฐ๋ฅผ ๊ตฌํํด๋ณด๊ฒ ์ต๋๋ค๐ง๐ป๐ป ์ฐ์ ์ด๋ฒ ๊ณ์ฐ๊ธฐ ํ๋ก์ ํธ ๊ฐ์ ๊ฒฝ์ฐ์๋ ReactorKit์ผ๋ก ์ด๋์ ๋ ์ ํํ๋ ๋ฆฌ์กํธ MVVM ์ํคํ ์ณ ํจํด์ ๋ฐ๋ฆ ๋๋ค. ์ฌ๊ธฐ ํฌ์คํ ์์๋ ํ์ ํ์ผ์ ๋ํ ๊ตฌํ๋ค๋ง ๊ฐ๋จํ ์๊ฐํ๊ณ ์๋ ์ Git ๋ ํฌ ์ฃผ์๋ฅผ ๋จ๊ฒจ๋๊ฒ ์ต๋๋ค! ๋ ์ฐธ๊ณ ํ์ค ๋ถ๋ค์ Git์ ์ฐธ๊ณ ํด์ฃผ์ธ์๐๐ป 1. View - ๋ทฐ๋ ์ฐ์ ์คํ ๋ฆฌ๋ณด๋๋ก UI์์ ๋ฐฐ์น์ ์คํ ๋ ์ด์์์ ์ ์ฉํ์ต๋๋ค. - ๊ทธ ํ ViewController์์ ReactorKit์ ์ํฌํธํ๊ณ ์คํ ๋ฆฌ๋ณด๋๋ทฐ๋ฅผ ์ฑํํ์ฌ ๋ฆฌ์กํธ์ ๋ฐ์ธ๋ฉ๋ ์ ์๊ฒ ๊ตฌํํ์์ต๋๋ค. import UIKit import ReactorKit import RxCocoa class CalculatorV..
-
์๊ฐ๋ณต์ก๋๋ฅผ ๊ณ ๋ คํ ์๊ณ ๋ฆฌ์ฆAlgorithm 2021. 6. 30. 12:30
์๋ ๋ฌธ์ ๋ ์ฝ๋๋ฆฌํฐ์์ ์ ๊ณตํ๋ FlogJmp์ ๋ฌธ์ ์ ๋๋ค๐ง๐ป๐ป ๋ฌธ์ ์ ์ A small frog wants to get to the other side of the road. The frog is currently located at position X and wants to get to a position greater than or equal to Y. The small frog always jumps a fixed distance, D. Count the minimal number of jumps that the small frog must perform to reach its target. Write a function: class Solution { public int solution(in..
-
์ค๋ณต ์ธ๋ฑ์ค๋ฅผ ํ์ฉํ ์๊ณ ๋ฆฌ์ฆAlgorithm 2021. 6. 29. 14:36
์๋ ๋ฌธ์ ๋ ์ฝ๋๋ฆฌํฐ์์ ์ ๊ณตํ๋ OddOccurrencesInArray์ ๋ฌธ์ ์ ๋๋ค๐ง๐ป๐ป ๋ฌธ์ ์ ์ A non-empty array A consisting of N integers is given. The array contains an odd number of elements, and each element of the array can be paired with another element that has the same value, except for one element that is left unpaired. For example, in array A such that: A[0] = 9 A[1] = 3 A[2] = 9 A[3] = 3 A[4] = 9 A[5] = 7 A[6] = 9 the e..
-
๋ฐฐ์ด์ ์ด์ฉํ ์๊ณ ๋ฆฌ์ฆAlgorithm 2021. 6. 28. 12:12
์๋ ๋ฌธ์ ๋ ์ฝ๋๋ฆฌํฐ์์ ์ ๊ณตํ๋ CyclicRotation์ ๋ฌธ์ ์ ๋๋ค๐ง๐ป๐ป ๋ฌธ์ ์ ์ An array A consisting of N integers is given. Rotation of the array means that each element is shifted right by one index, and the last element of the array is moved to the first place. For example, the rotation of array A = [3, 8, 9, 7, 6] is [6, 3, 8, 9, 7] (elements are shifted right by one index and 6 is moved to the first place). The goal i..
-
UIKitPlus - ViewLibrary 2021. 6. 26. 10:17
์๋ ํ์ธ์. ๊ทธ๋ฆฐ์ ๋๋ค๐ข ์ด๋ฒ ํฌ์คํ ์์๋ UIKitPlus์์ View์ ๋ํด ํ์ตํด๋ณด๊ฒ ์ต๋๋ค๐ง๐ป๐ป View๋ฅผ ์ด๊ธฐํํ๊ณ ํ์๋ทฐ๋ฅผ ๋ค๋ฃจ๊ณ ์ค์ ํ๋๋ฑ ๋ทฐ๋ก ํ ์ ์๋ ๋ถ๋ถ์ ๋ํด ์ฌ๋ฌ ์์๋ฅผ ์ ์ํฉ๋๋ค. View - ๊ธฐ๋ณธ์ ์ผ๋ก ๋น ๋ทฐ๋ฅผ ์์ฑํ๊ธฐ ์ํด ์๋์ ๊ฐ์ด ์ ์ธํฉ๋๋ค. UView() - ๋ทฐ๋ฅผ ์ ์ธํ๋ฉฐ ํ์๋ทฐ๋ฅผ ์์ฑํฉ๋๋ค. UView { UView() UView() } - inline ํค์๋๋ก ํ์๋ทฐ๋ฅผ ์์๋ทฐ์ ๊ฐ์ฅ์๋ฆฌ์ ๋ง์ถ ์ ์์ต๋๋ค. UView(inline: MKMapView()) - body ํค์๋๋ฅผ ์ฌ๋ฌ๋ฒ ์ฌ์ฉํ์ฌ ์์๋ทฐ์ ํ์๋ทฐ๋ฅผ ์ฌ๋ฌ๋ฒ ์ถ๊ฐํ ์ ์์ต๋๋ค. UView().body { UView() UVSpace(8) UView() }.body { UView() }.body { UVi..
-
UIKitPlus - RootViewControllerLibrary 2021. 6. 23. 12:40
์๋ ํ์ธ์. ๊ทธ๋ฆฐ์ ๋๋ค๐ข ์ด๋ฒ ํฌ์คํ ์์๋ UIKitPlus์์ RootViewController์ ๋ํด ํ์ตํด๋ณด๊ฒ ์ต๋๋ค๐ง๐ป๐ป RootViewController? ๋ฃจํธ ๋ค๋น๊ฒ์ด์ ๋ทฐ ์ปจํธ๋กค๋ฌ์ ํธ์ถ๊ณผ ์ฌ์ฉ๋ฒ์ ๋ํด ์ด๋ป๊ฒ ๊ตฌ์ฑ๋๋์ง ๋จ๊ณ๋ณ๋ก ์์๋ณด๊ฒ ์ต๋๋ค. 1. RootViewController ํ์ผ ์์ฑ ๋ฐ ์ ์ - RootViewController.swift ํ์ผ์ ์์ฑํ๊ณ RootController์ ์๋์ ๊ฐ์ด ์์ํ์ฌ ํ์ ๊ธฐ๋ฅ์ ์ ์ import UIKitPlus class RootViewController: SwifRootViewController { // ์ฑ ์์์ ์ด๊ธฐ ๋ทฐ ์ปจํธ๋กค๋ฌ ํ์ override var splashScreen: UIViewController { SplashView..
-
์ง์๋ณํ๊ณผ ๋ฌธ์์ด ์ธ๋ฑ์ค๋ฅผ ํตํ ์๊ณ ๋ฆฌ์ฆAlgorithm 2021. 6. 22. 14:15
์๋ ๋ฌธ์ ๋ ์ฝ๋๋ฆฌํฐ์์ ์ ๊ณตํ๋ Binary Gap์ ๋ฌธ์ ์ ๋๋ค๐ง๐ป๐ป ๋ฌธ์ ์ ์ A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N. For example, number 9 has binary representation 1001 and contains a binary gap of length 2. The number 529 has binary representation 1000010001 and contains two binary gaps: one of length 4 ..
-
๋๋ธ ํ๋ ธ์ด ์๊ณ ๋ฆฌ์ฆAlgorithm 2021. 6. 21. 11:22
์๋ ๋ฌธ์ ๋ ์ฝ๋๋ฆฌํฐ์์ ์ ๊ณตํ๋ ๋๋ธ ํ๋ ธ์ด์ ๋ฌธ์ ์ ๋๋ค๐ง๐ป๐ป ๋ฌธ์ ์ ์ You are given N disks and two rods, each with one initial disk. On the left rod, disks can be placed in decreasing order of size (smaller disks on top of bigger ones). On the right rod, disks can be placed in increasing order of size (bigger disks on top of smaller ones). Note that it is not permissible to place two disks of equal size on top of each ot..