일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- java
- 깃허브
- CLI명령어
- 회고
- CSS
- 컬렉션프레임워크
- 제네릭스
- 데일리코딩
- Spring Security
- Spring Data JDBC
- testing
- 페어프로그래밍
- 계산기만들기
- 스프링
- 첫글자대문자
- fibonacci
- HTML
- 문자열뒤집기
- FilterChain
- 백엔드
- 거듭제곱
- Publishing
- 부트캠프
- 백준알고리즘
- 그리디
- 인텔리제이
- 자료구조
- 알고리즘
- 자바
- spring data jpa
- Today
- Total
목록SEB/Daily Coding (11)
나의 모양
✏️ Description Return power input two numbers input base: int (base >= 2) exponent: int (exponent >= 0) output return long return rest of divided by 94,906,249 of the actual calculation results caution Avoid using Math.pow, power operators Time Complexity O(logN) example of in/output ong output = power(3, 40); System.out.println(output); // --> 19334827 📚 TIL Power: Multiply the same number mult..
✏️ Description Return whether the sample is a subset of the base by receiving two arrays input base: temporary Array with element of int sample: temporary Array with element of int output: boolean caution: no duplicates example of in/output int[] base = new int[]{1, 2, 3, 4, 5}; int[] sample = new int[]{1, 3}; boolean output = isSubsetOf(base, sample); System.out.println(output); // --> true sam..

✏️ Description 정수를 요소로 갖는 배열을 입력받아 3개의 요소를 곱해 나올 수 있는 최대값 리턴 입력: int[] 타입을 요소로 갖는 임의의 배열 출력: int 주의사항 주어진 배열은 중첩되지 않은 1차원 배열 배열 요소는 음수와 0을 포함하는 정수 배열 길이는 3 이상 입출력 예시 int output = largestProductOfThree(new int[]{2, 1, 3, 7}); // --> 42 (= 2 * 3 * 7) output = largestProductOfThree(new int[]{-1, 2, -5, 7}); // --> 35 (= -1 * -5 * 7) 📝 Flow - 가장 큰 수를 곱하기 => 오름차순 정렬해서 맨 뒤에 세 개 곱해줌 - 배열에 양수 있을 때 => 큰 ..
✏️ Description 수를 입력받아 제곱근 값을 소수점 두 자리까지 리턴 입력: int 타입의 정수 (num >= 2) 출력: String 최대 소수점 둘째 짜리까지 구한 수를 문자열로 변환하여 출력합니다. (소수점 셋째 자리에서 반올림) 입출력 예시 String output = computeSquareRoot(9); // --> "3.00" output = computeSquareRoot(6); // --> "2.45" 힌트 소수점 처리는 java 표준 내장 객체인 String를 사용 (java decimal places limit 또는 자바 소수점 자리수) 바빌로니아 법의 점화식(recurrence formula) https://ko.wikipedia.org/wiki/바빌로니아_법 📝 Flow ..
✏️ Description 문자열을 입력받아 아이소그램인지 여부를 리턴 입력: String 출력: boolean 입출력 예시 boolean output = isIsogram("aba"); // false output = isIsogram("Dermatoglyphics"); // true output = isIsogram("moOse"); // false 📝 Flow - 입력받은 문자열을 하나씩 잘라서 => split() - 문자열 배열에 담아서 순회 => forEach - 같은 문자가 있는지 앞뒤로 읽어오면서 비교 => indexOf, lastIndexOf - 문자 비교해서 같은게 있으면 false 리턴 🤯 Trouble 대소문자는 구별하지 않는다고 해서 a == A 로 생각했다. ⇒ 값이 안나옴 a ≠..
✍🏻 Description Return String with one space from two spaces 📝 Flow - 단어 한 글자씩 읽어와서 담을 문자배열변수 만들기 => split() - 공백 2개가 들어왔을 때 공백 1개를 words로 => join() - 문자배열을 문자열로 리턴 📚 TIL 코드를 이것저것 많이 썼는데 단 두 줄로 끝날 수 있는 것이 허무했지만 코드를 개선(?)하는 방법을 알았다고 생각하기로,,, 👩🏻💻 코드 String[] words = str.split(" "); return String.join(" ", words);
✍🏻 Description 2차원 배열을 입력받아 각 배열로 만든 HashMap 리턴 입출력 예시 String[][] arr = new String[]{ {'make', 'Ford'}, {'model', 'Mustang'}, {'year', '1964'}, {'make', 'Bill'}, }; HashMap output = convertListToObject(arr); System.out.println(output) { "make" = "Ford" "model" = "Mustang", "year" = "1964" } 📝 Flow 1. 해시맵 생성 및 초기화 2. 빈 배열은 빈 HashMap 리턴 3. 2차원 배열을 순회하면서 - 중복키 == 초기값 => put 4. 2차원배열을 해시맵으로 ... 음 ....
✍🏻 Description 문자열을 입력받아 문자열을 구성하는 각 단어의 첫 글자가 대문자인 문자열 리턴 📝 Flow 1. 문자열로 이루어진 단어를을 돌리면서 담아줄 배열 만들기 - 단어 공백으로 구분 => .split(); 2. 결과값 담을 변수 만들기 3. 단어 순회 => for - String.valueOf(), substring() 4. 각 단어 첫글자 대문자 => .toUpperCase() 5. 문자열 join 5. 문자열 리턴 🤯 Difficulty 문자열을 읽어오는 것 공백으로 구분된 단어 앞을 대문자로 만드는 것 🪆 Attempt 단어 구분 → for문에서 문자열 반복 → 첫 글자 대문자 split한 문자열 join 📚 TIL split() 리턴: 문자열 → 문자열 배열 Parameters..