포스트

87. 아이스 아메리카노


1
2
3
4
5
6
7
8
9
10
11
12
import Foundation

func solution(_ money:Int) -> [Int] {

    var answer : [Int] = []

    answer.append(money/5500)
    answer.append(money%5500)


    return answer
}

append를 이용하여 해결하였다.

다른 코드를 보니 그냥 배열안에 다이렉트로 해도 되었다.

[money/5500, money%5500] 이런식이었다.

이 기사는 저작권자의 CC BY 4.0 라이센스를 따릅니다.