일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Proxy
- terraform
- Jpa Auditing
- container
- controlleradvice
- MockBean
- weaving
- ci/cd
- cache
- JPA
- Packer
- ansible
- Deserializer
- launch-template
- SpyBean
- docker
- AWS
- ehcache
- DevOps
- golang
- HandlerMethodArgumentResolver
- AOP
- spring
- serializer
- gocd
- junit
- playbook
- persistence
- LocalDateTime
- rest-api
- Today
- Total
목록CS/Algorithm (19)
기록용 블로그
Codility 5-2 PassingCars PassingCars A non-empty array A consisting of N integers is given. The consecutive elements of array A represent consecutive cars on a road. Array A contains only 0s and/or 1s: 0 represents a car traveling east, 1 represents a car traveling west. The goal is to count passing cars. We say that a pair of cars (P, Q), where 0 ≤ P < Q < N, is passing when P is traveling to t..
매일프로그래밍 - 가장 긴 SubString의 길이 매일프로그래밍 - Question 10 String이 주어지면, 중복된 char가 없는 가장 긴 서브스트링 (substring)의 길이를 찾으시오. 예제) Input: “aabcbcbc” Output: 3 // “abc” Input: “aaaaaaaa” Output: 1 // “a” Input: “abbbcedd” Output: 4 // “bced” 요즘따라 왜 이렇게 잘 못하는 스트링 관련 문제가 많은지 모르겠다. 해커랭크의 두 문제부터, 매일 프로그래밍에서 준 문제도 죄다 스트링 관련 문제.. 셋 다 진짜 잘 모르겠다. 1시간 가량 고민하다가 그냥 답이 너무 대놓고 있어서 봤는데 진짜 다들 머리가 참 좋은것 같다. 답의 전부를 보지 않고, 힌트만 살..
Hackerrank - Bear and Steady Gene Bear and Steady Gene A gene is represented as a string of length (where is divisible by ), composed of the letters , , , and . It is considered to be steady if each of the four letters occurs exactly times. For example, and are both steady genes. Bear Limak is a famous biotechnology scientist who specializes in modifying bear DNA to make it steady. Right now, he..
Hackerrank - Common Child Common Child A string is said to be a child of a another string if it can be formed by deleting 0 or more characters from the other string. Given two strings of equal length, what's the longest string that can be constructed such that it is a child of both? For example, ABCD and ABDC have two children with maximum length 3, ABC and ABD. They can be formed by eliminating..
Codility 5-1 CountDiv CountDiv Write a function: class Solution { public int solution(int A, int B, int K); } that, given three integers A, B and K, returns the number of integers within the range [A..B] that are divisible by K, i.e.: { i : A ≤ i ≤ B, i mod K = 0 } For example, for A = 6, B = 11 and K = 2, your function should return 3, because there are three numbers divisible by 2 within the r..
백준 온라인 저지 - 연결 요소의 개수 방향 없는 그래프가 주어졌을 때, 연결 요소 (Connected Component)의 개수를 구하는 프로그램을 작성하시오. 입력 첫째 줄에 정점의 개수 N과 간선의 개수 M이 주어진다. (1 ≤ N ≤ 1,000, 0 ≤ M ≤ N×(N-1)/2) 둘째 줄부터 M개의 줄에 간선의 양 끝점 u와 v가 주어진다. (1 ≤ u, v ≤ N, u ≠ v) 같은 간선은 한 번만 주어진다. 출력 첫째 줄에 연결 요소의 개수를 출력한다. 예제 입력 1 복사 6 5 1 2 2 5 5 1 3 4 4 6 예제 출력 1 복사 2 예제 입력 2 복사 6 8 1 2 2 5 5 1 3 4 4 6 5 4 2 4 2 3 예제 출력 2 복사 1 힌트 출처 문제를 만든 사람: baekjoon 잘못..
백준 온라인 저지 - DFS와 BFS 문제 그래프를 DFS로 탐색한 결과와 BFS로 탐색한 결과를 출력하는 프로그램을 작성하시오. 단, 방문할 수 있는 정점이 여러 개인 경우에는 정점 번호가 작은 것을 먼저 방문하고, 더 이상 방문할 수 있는 점이 없는 경우 종료한다. 정점 번호는 1번부터 N번까지이다. 입력 첫째 줄에 정점의 개수 N(1 ≤ N ≤ 1,000), 간선의 개수 M(1 ≤ M ≤ 10,000), 탐색을 시작할 정점의 번호 V가 주어진다. 다음 M개의 줄에는 간선이 연결하는 두 정점의 번호가 주어진다. 한 간선이 여러 번 주어질 수도 있는데, 간선이 하나만 있는 것으로 생각하면 된다. 입력으로 주어지는 간선은 양방향이다. 출력 첫째 줄에 DFS를 수행한 결과를, 그 다음 줄에는 BFS를 수행..
Codility 4-3 MissingInteger MissingInteger This is a demo task. Write a function: class Solution { public int solution(int[] A); } that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A. For example, given A = [1, 3, 6, 4, 1, 2], the function should return 5. Given A = [1, 2, 3], the function should return 4. Given A = [−1, −3], the ..
Codility 4-2 FrogRiverOne Codility 4-2 FrogRiverOne A small frog wants to get to the other side of a river. The frog is initially located on one bank of the river (position 0) and wants to get to the opposite bank (position X+1). Leaves fall from a tree onto the surface of the river. You are given a zero-indexed array A consisting of N integers representing the falling leaves. A[K] represents th..
Codility 4-1 PermCheck Codility 4-1 PermCheck A non-empty zero-indexed array A consisting of N integers is given. A permutation is a sequence containing each element from 1 to N once, and only once. For example, array A such that: A[0] = 4 A[1] = 1 A[2] = 3 A[3] = 2 is a permutation, but array A such that: A[0] = 4 A[1] = 1 A[2] = 3 is not a permutation, because value 2 is missing. The goal is..