[iOS / Swift] 공배수

justdotheg·2024년 1월 29일

문제

풀이

import Foundation

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

💁🏻‍♂️ 요약

  • return 생략 가능

0개의 댓글