Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 자료구조
- retain cycle
- CarouselCollectionview
- til
- NavigationSearchBar
- 테이블뷰 나누기
- tableview section별 다른 cell적용
- TableView Section
- Value Type Reference Type
- Input Output
- wil
- 양궁대회
- Carousel CollectionView
- 면접을 위한 CS 전공 지식 노트 Tree
- Array vs Linked List
- UIKit
- TableView
- 강한 참조 순환
- ReferceCycle
- 면접을 위한 CS전공 지식 노트
- @escaping
- class struct
- UserDefaults
- 롤케이크 자르기
- coremotion
- 프로그래머스
- SWIFT
- Reference Cycle
- firebase
- CoreData
Archives
- Today
- Total
목록롤케이크 자르기 (1)
개발하는 동글 :]
[TIL],[프로그래머스],[롤케이크 자르기],[Swift]
import Foundation func solution(_ topping:[Int]) -> Int { var array1:[Int:Int] = [:] var array2:[Int:Int] = [:] var count = 0 for i in topping{ if array1[i] == nil{ array1[i] = 1 } else { array1[i]! += 1 } } for i in topping{ if array1[i]! == 1{ array1[i] = nil } else { array1[i]! -= 1 } if array2[i] == nil{ array2[i] = 1 } else { array2[i]! += 1 } if array1.keys.count == array2.keys.count{ coun..
카테고리 없음
2023. 8. 23. 20:44