분류 전체보기
-
Array (Struct) 순서가 지정된 무작위 액세스 collection Array | Apple Developer Documentation An ordered, random-access collection. developer.apple.com 배열은 앱에서 가장 많이 사용되는 데이터 타입 중 하나 앱의 데이터를 구성할 때 배열을 사용 특히 배열을 사용하여 단일 유형의 element, 즉 배열의 element 유형을 보유 배열은 Int형부터 String, Class까지 모든 종류의 element를 저장 가능 예전 포스팅 [Swift] 배열 참조 : Swift 스위프트 프로그래밍 3판 Swift 5, 저자 야곰 (한빛미디어) , The Swift Programming Language Swift 5.6 E..
[Swift] 공식문서 파헤치기 (Array, Set, Dictionary)Array (Struct) 순서가 지정된 무작위 액세스 collection Array | Apple Developer Documentation An ordered, random-access collection. developer.apple.com 배열은 앱에서 가장 많이 사용되는 데이터 타입 중 하나 앱의 데이터를 구성할 때 배열을 사용 특히 배열을 사용하여 단일 유형의 element, 즉 배열의 element 유형을 보유 배열은 Int형부터 String, Class까지 모든 종류의 element를 저장 가능 예전 포스팅 [Swift] 배열 참조 : Swift 스위프트 프로그래밍 3판 Swift 5, 저자 야곰 (한빛미디어) , The Swift Programming Language Swift 5.6 E..
2023.11.11 -
func solution(_ array:[Int], _ n:Int) -> Int { return array.sorted().sorted { abs($0-n) Int { a zoiworld.tistory.com
[Programmers] 가까운 수func solution(_ array:[Int], _ n:Int) -> Int { return array.sorted().sorted { abs($0-n) Int { a zoiworld.tistory.com
2023.11.10 -
func solution(_ s:String) -> Int { var arr = s.split(separator: " ") var result = 0 for (i,j) in arr.enumerated() { if j == "Z" { result -= Int(String(arr[i - 1]))! } else { result += Int(j)! } } return result } 참고
[Programmers] 컨트롤 제트func solution(_ s:String) -> Int { var arr = s.split(separator: " ") var result = 0 for (i,j) in arr.enumerated() { if j == "Z" { result -= Int(String(arr[i - 1]))! } else { result += Int(j)! } } return result } 참고
2023.11.09 -
func solution(_ my_string:String) -> String { var res = "" for i in my_string{ if !res.contains(i){ res += String(i) } } return res } 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 출처 [프로그래머스] 중복된 문자 제거(Swift) 화이팅하자 velog.io
[Programmers] 중복된 문자 제거func solution(_ my_string:String) -> String { var res = "" for i in my_string{ if !res.contains(i){ res += String(i) } } return res } 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 출처 [프로그래머스] 중복된 문자 제거(Swift) 화이팅하자 velog.io
2023.11.09 -
UISceneDelegate Scene 내에서 발생하는 수명 주기(Life Cycle) 이벤트에 응답하는 데 사용하는 핵심 방법 UISceneDelegate | Apple Developer Documentation The core methods you use to respond to life-cycle events occurring within a scene. developer.apple.com Connecting and disconnecting the scene scene(_:willConnectTo:options:) : Delegate에 앱의 Scene을 추가하는 것을 알림 func scene(_ scene: UIScene, willConnectTo session: UISceneSession, opt..
[Swift] UISceneDelegateUISceneDelegate Scene 내에서 발생하는 수명 주기(Life Cycle) 이벤트에 응답하는 데 사용하는 핵심 방법 UISceneDelegate | Apple Developer Documentation The core methods you use to respond to life-cycle events occurring within a scene. developer.apple.com Connecting and disconnecting the scene scene(_:willConnectTo:options:) : Delegate에 앱의 Scene을 추가하는 것을 알림 func scene(_ scene: UIScene, willConnectTo session: UISceneSession, opt..
2023.11.09 -
func solution(_ n:Int) -> [Int] { var num = n var result: Set = [] var cnt = 2 while num != 1 { if num % cnt == 0 { num = num / cnt result.update(with: cnt) cnt = 2 } else { cnt += 1 } } return Array(result).sorted() } 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 참고 [swift] 프로그래머스 - 소인수분해 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머..
[Programmers] 소인수분해func solution(_ n:Int) -> [Int] { var num = n var result: Set = [] var cnt = 2 while num != 1 { if num % cnt == 0 { num = num / cnt result.update(with: cnt) cnt = 2 } else { cnt += 1 } } return Array(result).sorted() } 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 참고 [swift] 프로그래머스 - 소인수분해 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머..
2023.11.08