코틀린 Level 1(3)
-
프로그래머스 알고리즘 Level 1 숫자 짝궁 코틀린
https://school.programmers.co.kr/learn/courses/30/lessons/131128 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 풀이 - 성공 class Solution { fun solution(X: String, Y: String): String = X.filter { Y.contains(it) } .groupBy { it } .map {if (it.value.size < Y.groupBy { it }[it.key]!!.size) it.value else Y.groupBy { it }[it.key]!!} .flatte..
2023.01.27 -
프로그래머스 알고리즘 Level 1 2019 카카오 개발자 겨울 인턴쉽 크레인 인형뽑기 게임
https://school.programmers.co.kr/learn/courses/30/lessons/64061 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 풀이 - 성공 class Solution { fun solution(board: Array, moves: IntArray): Int { var answer = 0 val list = mutableListOf() for (moveIndex in moves.indices) { val moveColumn = moves[moveIndex] - 1 for (itemRow in board.indices) {..
2023.01.25 -
프로그래머스 알고리즘 Level 1 코틀린 2021 KAKAO BLIND RECRUITMENT신규 아이디 추천
https://school.programmers.co.kr/learn/courses/30/lessons/72410 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 풀이 - 성공 class Solution { fun solution(new_id: String): String { val new = new_id.lowercase() .replace("[^a-z0-9_.-]".toRegex(),"") .replace("[.]{2,}".toRegex(), ".") .replace("^[.]|$[.]".toRegex(),"") .let { it.ifEmpty { "a..
2023.01.25