프로그래머스/Lv.0
프로그래머스 코딩테스트 연습 Lv.0 Swift
-
import Foundation func solution(_ strlist:[String]) -> [Int] { return strlist.map { $0.count } }
[Swift] 배열 원소의 길이import Foundation func solution(_ strlist:[String]) -> [Int] { return strlist.map { $0.count } }
2022.12.17 -
import Foundation func solution(_ num_list:[Int]) -> [Int] { return num_list.reversed() }
[Swift] 배열 뒤집기import Foundation func solution(_ num_list:[Int]) -> [Int] { return num_list.reversed() }
2022.12.17 -
import Foundation func solution(_ numbers:[Int]) -> [Int] { return numbers.map{$0 * 2} }
[Swift] 배열 두배 만들기import Foundation func solution(_ numbers:[Int]) -> [Int] { return numbers.map{$0 * 2} }
2022.12.17 -
import Foundation func solution(_ my_string:String) -> String { return String(my_string.reversed()) }
[Swift] 문자열안에 문자열import Foundation func solution(_ my_string:String) -> String { return String(my_string.reversed()) }
2022.12.17 -
import Foundation func solution(_ my_string:String) -> String { my_string.map { String($0).lowercased() }.sorted().joined() }
[Swift] 문자열 정렬하기 (2)import Foundation func solution(_ my_string:String) -> String { my_string.map { String($0).lowercased() }.sorted().joined() }
2022.12.17 -
import Foundation func solution(_ my_string:String) -> [Int] { return my_string.compactMap { Int(String($0)) }.sorted() }
[Swift] 문자열 정렬하기 (1)import Foundation func solution(_ my_string:String) -> [Int] { return my_string.compactMap { Int(String($0)) }.sorted() }
2022.12.17 -
import Foundation func solution(_ A:String, _ B:String) -> Int { let arr = (A+A).components(separatedBy: B) return arr.count == 1 ? -1 : arr[1].count }
[Swift] 문자열 밀기import Foundation func solution(_ A:String, _ B:String) -> Int { let arr = (A+A).components(separatedBy: B) return arr.count == 1 ? -1 : arr[1].count }
2022.12.17 -
import Foundation func solution(_ my_string:String) -> String { return String(my_string.reversed()) }
[Swift] 문자열 뒤집기import Foundation func solution(_ my_string:String) -> String { return String(my_string.reversed()) }
2022.12.17