69. n보다 커질 때 까지 더하기
import Foundation func solution(_ numbers:[Int], _ n:Int) -> Int { var answer : Int = 0 var i : Int = 0 while answer <= n { answer += numbers[i] i +...
import Foundation func solution(_ numbers:[Int], _ n:Int) -> Int { var answer : Int = 0 var i : Int = 0 while answer <= n { answer += numbers[i] i +...
import Foundation func solution(_ todo_list:[String], _ finished:[Bool]) -> [String] { var answer : [String] = [] for i in todo_list.indices { if finished[i] == f...
import Foundation func solution(_ names:[String]) -> [String] { var answer : [String] = [] answer = stride(from:0, to:names.count, by:5).map{names[$0]} ...
import Foundation func solution(_ num_list:[Int]) -> Int { var odd : Int = 0 var even : Int = 0 var answer : Int = 0 for i in num_list.indices { if i % 2 =...
import Foundation func solution(_ num_list:[Int], _ n:Int) -> [Int] { var answer : [Int] = [] answer = stride(from:0, through:num_list.count-1, by:n).map{num_list[$0]} ...
import Foundation func solution(_ num_list:[Int], _ n:Int) -> [Int] { var answer : [Int] = [] answer = Array(num_list[..<n]) return answer } 슬라이싱을 하면 되는 문제...
import Foundation func solution(_ str_list:[String]) -> [String] { var answer : [String] = [] for i in str_list.indices { if str_list.count == 1 { answ...
import Foundation func solution(_ num_list:[Int], _ n:Int) -> [Int] { var answer : [Int] = [] answer = Array(num_list[n...]) + Array(num_list[..<n]) return answer } ...
이렇게 한 이유.