일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- greedy
- Counting
- Stack
- hash table
- array
- 자바
- 구현
- Binary Tree
- geometry
- bit manipulation
- Number Theory
- Data Structure
- string
- database
- 파이썬
- Binary Search
- implement
- SQL
- Tree
- dynamic programming
- two pointers
- 코딩테스트
- simulation
- Math
- 코테
- Class
- java
- Matrix
- Method
- sorting
- Today
- Total
목록분류 전체보기 (1234)
코린이의 소소한 공부노트
1. Input 1) String s 2) int k 2. Output 1) s를 n개의 그룹으로 나누고, 그룹 사이에는 ‘-’를 1개씩 넣은 문자열을 반환 - 이때 첫 번째 그룹을 제외한 나머지 그룹은 반드시 1개 이상 k개 이하의 문자가 들어가야 한다. 3. Constraint 1) 1
1. Input 1) String s 2. Output 1) s의 한 부분 문자열을 반복해서 s를 만들 수 있다면 true, 만들 수 없다면 false를 반환 3. Constraint 1) 1 Output: false 5. Code 1) 첫 코드(2023/05/19) class Solution { public boolean repeatedSubstringPattern(String s) { boolean find = false; for(int i=1 ; i
1. Input 1) String num1 2) String num2 2. Output 1) num1과 num2의 합을 문자열로 반환 - BigInteger와 같은 빌트인 라이브러리 사용 금지 3. Constraint 1) 1 Output: "533" 5. Code 1) 첫 코드(2023/05/19) class Solution { public String addStrings(String num1, String num2) { Stack stack = new Stack(); int carry = 0, i1 = num1.length()-1, i2 = num2.length()-1; while(i1>=0 || i2>=0){ int x = carry; if(i1>=0) x += num1.charAt(i1--)-'0..
1. Input 1) String s 2) String t 2. Output 1) s가 t의 subsequence라면 true, 아니면 false를 반환 - subsequence란 문자가 연속적이지 않아도 차례대로 다른 문자열에 순서대로 있는 것을 말한다. 예를 들면 “ace"는 "abcde"의 subsequence지만 ”aec"는 아니다. 3. Constraint 1) 0
목표: 배열의 부분 합을 계산하는 클래스 구현 - 생성자 - int sumRange(int left, int right) 1. Input 1) 생성자: int[] nums; 2) sumRange(): 부분 합을 구할 인덱스의 범위 2. Output 1) sumRange(): nums[left]부터 nums[right]까지의 합 3. Constraint 1) 1
1. Input 1) String s 2) String t 2. Output 1) s가 t가 되기 위해서 추가해야 하는 문자를 반환 3. Constraint 1) 0
1. Input 1) String s 2. Output 1) s의 문자 중 반복되지 않는 첫번째 문자열의 인덱스를 반환 2) 만약 그런 문자가 없다면 -1을 반환 3. Constraint 1) 1 Output: -1 설명: - 반복되지 않는 문자는 l, t, c, o, d이며, 이 중 첫번째로 나오는 문자는 l이므로 l의 인덱스인 0을 반환한다. - 반복되지 않는 문자가 없으므로 -1을 반환한다. 5. Code 1) 첫 코드(2023/05/18) class Solution { public int firstUniqChar(String s) { int ans = -1; HashMap m = new HashMap(); for(int i=0 ; i
1. Input 1) int[] nums1 2) int[] nums2 2. Output 1) nums1과 nums2의 교집합을 반환 - 이때 중복되는 요소는 1번만 포함한다. - 담는 순서는 상관 없다. 3. Constraint 1) 1

1. 입력 - 첫째 줄에 정수 N (1 ≤ N ≤ 10,000,000)이 주어진다. 2. 출력 - N의 소인수분해 결과를 한 줄에 하나씩 오름차순으로 출력한다. N이 1인 경우 아무것도 출력하지 않는다. 3. 예제 4. 코드 import java.util.*; import java.io.*; class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int n = Int..