
https://programmers.co.kr/learn/courses/30/lessons/42576 코딩테스트 연습 - 완주하지 못한 선수 수많은 마라톤 선수들이 마라톤에 참여하였습니다. 단 한 명의 선수를 제외하고는 모든 선수가 마라톤을 완주하였습니다. 마라톤에 참여한 선수들의 이름이 담긴 배열 participant와 완주한 선수�� programmers.co.kr [풀이 과정] 1. 참가자의 이름이 동일할 수 있기 때문에 Map을 활용하여 몇 명인지 확인한다. 2. 참가자의 이름을 key로, 해당 이름을 가진 선수의 수를 value로 설정한다. 3. 참가장 한 명당 value를 1씩 증가시킨다. 4. 완주자 한 명당 value를 1씩 감소시킨다. 5. 완주자가 아닌(value가 0이 아닌) 사람을 ..

https://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 [풀이 과정] 1. board의 최대 크기가 30, moves의 최대 크기가 1,000 이므로 O(N^2) 정도는 충분히 가능하다. 2. moves에 주어진 값들에 해당하는 인형(0이 아닌 값)들을 차례로 꺼내어 바구니(Stack)에 담는다. 3. 인형을 꺼내면 해당 위치의 값을 0으로 바꾼다. 4. 바구니에 담았을 때, 같은 인형이면 두 개가 없어진다. 5. 인형이 없어지는 개수를 구해..

Kotlin(native / JVM)으로 풀어보기 11654 아스키 코드 (native) fun main() { println(readLine()!!.single().toInt()) } 11720 숫자의 합 (native) fun main() { val count = readLine()!!.toInt() println(readLine()!!.chunked(1).subList(0, count).map { it.toInt() }.sum()) } 10809 알파벳 찾기 (JVM) fun main() { readLine()!!.apply { for (key in 'a'..'z') { print("${this.indexOf(key)} ") } } } 2675 문자열 반복 (native) fun main() { r..

Kotlin(native / JVM)으로 풀어보기 4673 셀프 넘버 (native) fun constructor(number: Int): Int { return number + sumOfNumbers(number) } fun sumOfNumbers(number: Int): Int { var digit = number var sum = 0 while (digit != 0) { sum += (digit % 10) digit /= 10 } return sum } fun main() { val list = linkedSetOf() for (i in 1..10000) { list.add(i) } for (i in 1..10000) { list.remove(constructor(i)) } list.forEach ..

Kotlin(native / JVM)으로 풀어보기 10818 최소, 최대 (JVM) import java.io.BufferedReader import java.io.BufferedWriter import java.io.InputStreamReader import java.io.OutputStreamWriter fun main() { val bufferedReader = BufferedReader(InputStreamReader(System.`in`)) val bufferedWriter = BufferedWriter(OutputStreamWriter(System.out)) val count = bufferedReader.readLine().toInt() val array = bufferedReader.re..

Kotlin(native / JVM)으로 풀어보기 10952 A + B - 5 (native) fun main() { while (true) { val (a, b) = readLine()!!.split(' ').map { it.toInt() } if (a == 0 && b == 0) break println("${a + b}") } } 10952 A + B - 4 (JVM) import java.util.* fun main() { Scanner(System.`in`).apply { while (this.hasNextInt()) { println(this.nextLine().split(' ').map { it.toInt() }.sum()) } } } 1110 더하기 사이클 (native) fun main(..

Kotlin(native / JVM)으로 풀어보기 2739 구구단 (native) fun main() { val target = readLine()?.toInt() ?: 0 for (i in 1 until 10) { println("$target * $i = ${target * i}") } } 10950 A + B - 3 (native) fun readInt() = readLine()!!.split(' ').map { it.toInt() } fun main() { val count = readLine()?.toInt() ?: 0 for (i in 1..count) { println("${readInt().sum()}") } } 8393 합 (native) fun main() { val n = readLi..

Kotlin(native / JVM)으로 풀어보기 2557 Hello World! (native) fun main() { println("Hello World!") } 10718 We love kriii (native) fun main() { for (i in 1..2) { println("강한친구 대한육군") } } 10171 고양이 (native) fun main() { println("""\ /\ ) ( ') ( / ) \(__)|""") } 10172 개 (native) fun main() { println("""|\_/| |q p| /} ( 0 )""${'"'}\ |"^"` | ||_/=\\__|""") } 1000 A + B (native) fun readInt() = readLine()!!...
- Total
- Today
- Yesterday
- 2019 카카오 개발자 겨울 인턴십
- OS
- 그리디
- DP
- Idempotent
- spring boot 2.3.1
- 구현
- git
- dfs
- Algorihtm
- 2020 카카오 인턴십
- 그래프
- BOJ
- 열혈강의
- 알고리즘
- Summer/Winter Coding(~2018)
- 백준
- Python
- 단계별로 문제풀이
- binary search
- Algorithm
- programmers
- 코틀린
- 자료구조
- repository
- 이것이 코딩테스트다
- 저장소
- 정렬
- 깃
- bfs
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |