func solution(_ x:Int, _ n:Int) -> [Int64] {
var arr = [Int64]()
for num in 1...n {
arr.append(Int64(x*num))
}
return arr
}
'알고리즘문풀 with SWIFT > Programmers' 카테고리의 다른 글
swift ) 프로그래머스 - 핸드폰 번호 가리기 (0) | 2022.05.23 |
---|---|
swift ) 프로그래머스 - 행렬의 덧셈 (0) | 2022.05.23 |
swift ) 프로그래머스 - 직사각형 별찍기 (0) | 2022.05.23 |
swift ) 프로그래머스 - 모의고사 (수포자) (0) | 2022.05.07 |
swift ) 프로그래머스 - 체육복 (0) | 2022.05.07 |