[Swift] 프로그래머스 입문 문제, 369게임
·
코딩테스트
문제 풀이 방법함수 인자를 String으로 강제 변환고차함수인 map을 이용해서 result 카운팅 코드import Foundationfunc solution(_ order:Int) -> Int { var result = 0 String(order).map { if String($0) == "3" || String($0) == "6" || String($0) == "9" { result += 1 } } return result}