[iOS / Swift] n의 배수

justdotheg·2024년 1월 28일

문제

풀이

import Foundation

func solution(_ num:Int, _ n:Int) -> Int {
    num % n == 0 ? 1 : 0
}

💁🏻‍♂️ 요약

  • 펑션에서 return 키워드 생략 가능

0개의 댓글