일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Math
- Number Theory
- 자바
- geometry
- bit manipulation
- database
- 코딩테스트
- greedy
- string
- Binary Tree
- dynamic programming
- 구현
- Class
- Data Structure
- Counting
- array
- 파이썬
- two pointers
- hash table
- Binary Search
- simulation
- Method
- Matrix
- Stack
- 코테
- Tree
- implement
- SQL
- java
- sorting
- Today
- Total
목록자바 (584)
코린이의 소소한 공부노트
1. Input 1) 정수 n 2. Output 1) n의 약수를 오름차순으로 담은 정수 배열 3. Constraint 1) 1
1. Input 1) 문자열 s 2. Output 1) s에서 한 번만 등장하는 문자를 사전 순으로 정렬한 문자열 3. Constraint 1) 0 Output="abcd" Input: s="hello" -> Output="eho" 5. Code 1) 첫 코드(2022/10/31) int[] alphabet = new int[26]; for(int i=0 ; i
1. Input 1) 문자열 my_string 2) 정수 num1 3) 정수 num2 2. Output 1) my_string에서 인덱스 num1과 인덱스 num2에 해당하는 문자를 바꾼 문자열 3. Constraint 1) 1 Output: “hlelo” 5. Code 1) 첫 코드(2022/10/31) return my_string.substring(0,num1) + String.valueOf(my_string.charAt(num..
1. Input 1) 문자열 numbers 2. Output 1) numbers를 정수로 바꿔서 반환 3. Constraint 1) numbers는 소문자로만 구성되어 있다. 2) numbers는 "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" 들이 공백 없이 조합되어 있다. 3) 1 ≤ numbers의 길이 ≤ 50 4) "zero"는 numbers의 맨 앞에 올 수 없다. 4. Example Input: number="onefourzerosixseven" -> Output: 14067 5. Code 1) 첫 코드(2022/10/31) import java.util.ArrayList; // main() Arra..
1. Input 1) 문자열 my_string 2. Output 1) 대문자는 소문자로, 소문자는 대문자로 변환한 문자열 3. Constraint 1) 1 ≤ my_string의 길이 ≤ 1,000 2) my_string은 영어 대소문자로만 구성되어 있다. 4. Example Input: my_string=“aaaAAA” -> Output: “AAAaaa” 5. Code 1) 첫 코드(2022/10/28) String answer = ""; for(int i=0 ; i=97) answer += String.valueOf((char)(c-32)); else answer += String.valueOf((char)(c+32)); } return answer; - answer += (char)(c-32) 로 ..
1. Input 1) 문자열 cipher 2) 정수 code 2. Output 1) 해독된 암호 2) cipher에서 code의 배수 번째 글자만 진짜 암호 3. Constraint 1) 1 ≤ cipher의 길이 ≤ 1,000 2) 1 ≤ code ≤ cipher의 길이 3) cipher는 소문자와 공백으로만 구성되어 있다. 4) 공백도 하나의 문자로 취급 4. Example Input: cipher=“hitcre”, code=2 -> Output: “ice” 설명: 2번째 글자는 i, 4번째 글자는 c, 6번째 글자는 e이므로 이를 합친 “ice”를 반환 5. Code 1) 첫 코드(2022/10/28) String answer = ""; for(int i=code-1 ; i
1. Input 1) 머쓱이가 말해야하는 숫자 order 2. Output 1) 머쓱이가 쳐야할 박수 횟수 2) order에 들어가는 3, 6, 9의 개수만큼 박수를 친다. 3. Constraint 1) 1 =1){ int r = order % 10; answer += (r%3==0 && r!=0) ? 1 : 0; order /= 10; } return answer;
1. Input 1) 정수 배열 array 2) 정수 n 2. Output 1) array에 들어있는 정수 중 n과 가장 가까운 수 3. Constraint 1) 1 ≤ array의 길이 ≤ 100 2) 1 ≤ array의 원소 ≤ 100 3) 1 ≤ n ≤ 100 4) 가장 가까운 수가 여러 개일 경우 더 작은 수를 반환 4. Example Input: array={3,10,28,12}, n=20 -> Output: 12 설명: 20과의 차가 가장 작은 것은 28과 12인데, 이 중 더 작은 12를 반환 5. Code 1) 첫 코드(2022/10/28) int answer=array[0], dif=array[0]-n; for(int i=1 ; i
1. Input 1) 숫자와 공백, “Z”로 이루어진 문자열 s 2. Output 1) 문자열이 뜻하는 값 2) “Z”가 나오면 바로 앞 숫자를 뺀다는 뜻이다. 3. Constraint 1) 0 Output: 4 Input: s=“1 2 Z Z 3” -> Output: 3 설명: ..
1. Input 1) 삼각형의 세 변의 길이가 담긴 배열 sides 2. Output 1) 세 변으로 삼각형을 만들 수 있다면 1을, 만들 수 없다면 2를 반환 2) 가장 긴 변의 길이는 다른 두 변의 길이의 합보다 작아야 삼각형이 완성됨 3. Constraint 1) sides의 원소는 자연수 2) sides의 길이는 3 3) 1 ≤ sides의 원소 ≤ 1000 4. Example Input: sides={1,2,3} -> Output: 2 Input: sides={3,4,5} -> Output: 1 설명: - 1 + 2 = 3 이므로 삼각형이 될 수 없다. - 3 + 4 > 5 이므로 삼각형이 될 수 있다. 5. Code 1) 첫 코드(2022/10/25) import java.util.Arrays..