154. 대문자와 소문자
import Foundation func solution(_ my_string:String) -> String { var answer = "" answer = my_string.map{String($0) == String($0).uppercased() ? String($0).lowercased() : St...
import Foundation func solution(_ my_string:String) -> String { var answer = "" answer = my_string.map{String($0) == String($0).uppercased() ? String($0).lowercased() : St...
import Foundation func solution(_ cipher:String, _ code:Int) -> String { var answer = "" var arr = cipher.map{String($0)} answer = stride(from:code-1, to:cipher.count,...
import Foundation func solution(_ my_string:String) -> Int { var answer = my_string.map{$0}.filter{$0.isNumber}.map{Int(String($0))!}.reduce(0,+) return answer } 기존에 왜 ...
import Foundation func solution(_ my_string:String) -> String { var answer : String = "" answer = my_string.components(separatedBy:["a","e","i","o","u"]).joined() ...
import Foundation func solution(_ my_string:String, _ n:Int) -> String { var result : String = "" for i in my_string { result += String(repeating:i, count:n) }...
import Foundation func solution(_ n:Int, _ t:Int) -> Int { var answer : Int = 0 answer = n * Int(pow(Double(2),Double(t))) return answer } 2의 t제곱씩 수가 증가하는것을 보...
import Foundation func solution(_ n:Int) -> Int { var answer : Int = 0 for i in 1...n { if n%i == 0 { answer += 1 } } return answe...
import Foundation func solution(_ sides:[Int]) -> Int { var answer : Int = 0 var arr : [Int] = [] arr=sides.sorted(by:>) answer = arr[0] < arr[1] + arr[...
import Foundation func solution(_ n:Int) -> Int { var answer : Int = 0 answer = String(n).map{Int(String($0))!}.reduce(0,+) return answer } 자릿수를 더하기위해서 map을 사용해 각각...