목록프로그래머스 알고리즘 문제 기록 (94)
Where who wants to meet someone
문제 https://school.programmers.co.kr/learn/courses/30/lessons/181836?language=swift 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 내 답안 / 다른 사람들의 답안 import Foundation func solution(_ picture:[String], _ k:Int) -> [String] { var multiplyPicture = [[String]]() picture.map { $0.map { String($0) } }.forEach { pixel in var newPixel = [Str..
문제 https://school.programmers.co.kr/learn/courses/30/lessons/181851 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 내 답안 / 다른 사람들의 답안 import Foundation func solution(_ rank:[Int], _ attendance:[Bool]) -> Int { var attendanceRank = [Int]() while attendanceRank.count < 3 { for i in 1...rank.count { if let index = rank.firstIndex(of: i)..
문제 https://school.programmers.co.kr/learn/courses/30/lessons/181858 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 내 답안 / 다른 사람들의 답안 import Foundation func solution(_ arr:[Int], _ k:Int) -> [Int] { var result = [Int]() arr.forEach { element in if !result.contains(element), result.count != k { result.append(element) } } if result.cou..
문제 https://school.programmers.co.kr/learn/courses/30/lessons/181846 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 내 답안 / 다른 사람들의 답안 import Foundation func solution(_ a:String, _ b:String) -> String { var a = a.map { Int(String($0))! } var b = b.map { Int(String($0))! } var result = [Int]() var upNumber = 0 if a.count < b.count { a ..
문제 https://school.programmers.co.kr/learn/courses/30/lessons/181837 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 내 답안 / 다른 사람들의 답안 import Foundation func solution(_ order:[String]) -> Int { return order.map { ["iceamericano", "americanoice", "hotamericano", "americanohot", "americano", "anything"].contains($0) ? 4500 : 5000 }.redu..