Swift 프로그래머스 팩토리얼
Swift 프로그래머스 팩토리얼 import Foundation func solution(_ n:Int) -> Int { var num = 1 var answer = 0 for i in 1...n{ num *= i if num == n { a...
talks, and writes related to "GameDev" like Shader, Algorithm, Design Pattern and . I Loves music & cat.
Swift 프로그래머스 팩토리얼 import Foundation func solution(_ n:Int) -> Int { var num = 1 var answer = 0 for i in 1...n{ num *= i if num == n { a...
Swift 프로그래머스 A로 B 만들기 import Foundation func solution(_ before:String, _ after:String) -> Int { let str1 = before.sorted() let str2 = after.sorted() var answer = 0...
Swift 프로그래머스 입문(6) 51. 외계 행성의 나이 import Foundation func solution(_ age:Int) -> String { var dic: [ Character : String ] = ["0" : "a", "1" : "b", "2" : "c", "3" : "d", "4" ...
Swift 프로그래머스 입문(5) 41. 세균 증식 import Foundation func solution(_ n:Int, _ t:Int) -> Int { var total = n for _ in 1...t{ total *= 2 } return total } 42. ...
Swift 프로그래머스 입문(4) 31. 배열 두 배 만들기 import Foundation func solution(_ numbers:[Int]) -> [Int] { var num = [Int]() for i in 0..<numbers.count{ num.append(numbe...