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
- ios
- APNS
- modern concurrency
- WWDC
- SWIFT
- 티스토리챌린지
- 오블완
- 야곰 # 야곰아카데미커리어스타터캠프 #iOS개발자 # 부트캠프
- modern concurrency deep dive
Archives
- Today
- Total
Geon
로또의 최고 순위와 최저 순위 본문
코드
func solution(_ lottos:[Int], _ win_nums:[Int]) -> [Int] {
let unKnown = lottos.filter { $0 == 0}.count
let dupliacte = win_nums.filter { lottos.contains($0)}.count
return [unKnown + dupliacte , dupliacte].map { $0 <= 1 ? 6 : 7-$0}
}
print(solution([1, 2, 3, 4, 5, 11], [31, 10, 45, 1, 6, 19]))
'코딩테스트' 카테고리의 다른 글
단어뒤집기[BOJ] (0) | 2022.03.22 |
---|---|
스택[BOJ] (0) | 2022.03.22 |
신고 결과 받기 (0) | 2022.03.18 |
신규 아이디 추천 (0) | 2022.03.15 |
숫자 문자열과 영단어 (0) | 2022.03.15 |