12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455import java.util.*; public class Level2_카펫 { public static int[] solution(int brown, int yellow) { // yellow 의 약수 쌍을 구한다. // 약수 쌍을 돌며 가능한 경우 모두 수식에 맞춰 brown 값을 맞춰본다. // w >= h // yellow 블럭의 w, h 를 구하는거니 return 할때는 w+2, h+2 해준다. List divisor = getDivisor(yellow); return findBrownCount(brown, divis..
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 import java.util.Arrays; public class Level2_HIndex { public static int solution(int[] citations) { Arrays.sort(citations); int hIndex = 0; int n = citations.length; for (int i = 0; i = h) { hIndex = h; break; } } return hIndex; } public static void main(String[] args) { int[] citations = {3, 0, 6, 1, 5}; System.out.println(soluti..
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 import java.util.*; public class Level2_위장 { public static int solution(String[][] clothes) { Map map = new HashMap(); for (String[] str: clothes) { String key = str[1]; map.put(key, map.getOrDefault(key, 0) + 1); } int answer = 1; for (int value : map.values()) { answer *= (value + 1); } return answer - 1; } public static void ma..
1234567891011121314151617import java.util.*; public class Level1_폰켓몬 { public static int solution(int[] nums) { Set set = new HashSet(); for (int num : nums) { set.add(num); } return Math.min(set.size(), nums.length/2); } public static void main(String[] args) { int[] nums = {3,3,3,2,2,4}; System.out.println(solution(nums)); }}Colored by Color Scriptercs
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 32 33 34 public class Level1_소수만들기 { static boolean[] primeMap = new boolean[3000]; public static int solution(int[] nums) { makePrimeMap(); int answer = 0; for (int i = 0; i
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859/* 1단계 new_id의 모든 대문자를 대응되는 소문자로 치환합니다. 2단계 new_id에서 알파벳 소문자, 숫자, 빼기(-), 밑줄(_), 마침표(.)를 제외한 모든 문자를 제거합니다. 3단계 new_id에서 마침표(.)가 2번 이상 연속된 부분을 하나의 마침표(.)로 치환합니다. 4단계 new_id에서 마침표(.)가 처음이나 끝에 위치한다면 제거합니다. 5단계 new_id가 빈 문자열이라면, new_id에 "a"를 대입합니다. 6단계 new_id의 길이가 16자 이상이면, new_id의 첫 15개의 문자를 ..
123456789101112131415161718192021222324252627282930public class Level1_3진법뒤집기 { public static int solution(int n) { int answer = 0; // 10진법 -> 3진법 뒤집은거 StringBuilder reverseThreeRadix = new StringBuilder(); while (n > 0) { reverseThreeRadix.append(n % 3); n /= 3; } // 3진법 -> 10진법 long before10 = Long.parseLong(reverseThreeRadix.toString()); int count = 0; while (before10 > 0) { long index = befo..
- Total
- Today
- Yesterday
- 킹수빈닷컴
- 프로그래머스 SQL
- 프로그래머스
- http
- 백기선 스터디
- 백준
- HTTP 완벽 가이드
- JPA 연관관계 매핑
- 패스트캠퍼스 컴퓨터공학 완주반
- JS 딥다이브
- Spring Security
- BOJ
- js api
- 이펙티브자바 아이템59
- 모던자바스크립트
- 김영한 http
- js array
- REST API
- java
- ㅇㄷㅇㅈ
- 이펙티브자바 스터디
- js promise
- 김영한 JPA
- GCP
- 이펙티브자바
- HTTP 완벽가이드
- 가상 면접 사례로 배우는 대규모 시스템 설계 기초
- dreamcoding
- 이펙티브자바 아이템60
- 드림코딩
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |