programmers.co.kr/learn/courses/30/lessons/42840 나의 풀이 import Foundation func solution(_ answers:[Int]) -> [Int] { let first: [Int] = [1, 2, 3, 4, 5] let second: [Int] = [2, 1, 2, 3, 2, 4, 2, 5] let third: [Int] = [3, 3, 1, 1, 2, 2, 4, 4, 5, 5] var firstScore: Int = 0 var secondScore: Int = 0 var thirdScore: Int = 0 for i in 0.. [Int] { let answer = ( a: [1, 2, 3, 4, 5], // index % 5 b: [2, 1, 2..
programmers.co.kr/learn/courses/30/lessons/72410 나의 풀이 import Foundation func solution(_ new_id:String) -> String { var newID = new_id //#1 newID = newID.lowercased() //#2 var arr2: [String.Element] = [] //"az09-_." Array(newID).forEach { c in if let value = c.asciiValue, value >= 97 && value = 48 && value = 16 { let index = newID.index(newID.startIndex, offsetBy: 15) newID = String(newID[newID...
programmers.co.kr/learn/courses/30/lessons/64061 코딩테스트 연습 - 크레인 인형뽑기 게임 [[0,0,0,0,0],[0,0,1,0,3],[0,2,5,0,1],[4,2,4,4,2],[3,5,1,3,1]] [1,5,3,5,1,2,1,4] 4 programmers.co.kr 나의 풀이 import Foundation func solution(_ board:[[Int]], _ moves:[Int]) -> Int { var board = board var arr: [Int] = [] var removeCount: Int = 0 for i in moves { for j in 0..