HIT해

[프로그래머스] 배열 두배 만들기 본문

Swift/Swift 알고리즘

[프로그래머스] 배열 두배 만들기

힛해 2024. 11. 28. 17:47
728x90

https://school.programmers.co.kr/learn/courses/30/lessons/120809?language=swift

 

프로그래머스

SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프

programmers.co.kr

 

import Foundation

func solution(_ numbers:[Int]) -> [Int] {
    
    var answers : [Int] = []
    
    answers = numbers.map{
        $0 * 2
    }
    
    return answers
}