일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 에이블 기자단
- kt에이블스쿨8기
- 기자단
- msaez
- 에이블스쿨 모집
- 데이터
- kt 에이블스쿨 8기
- kt에이블스쿨 8기
- kt 에이블스쿨 7기
- MSA
- kt aivle school 7기
- 후기
- aice associate
- 마이크로서비스
- 에이블스쿨 7기
- kt aivleschool 8기
- ktaivleschool7기
- KT에이블스쿨
- 7일 전사
- ktaivleschool
- KT 에이블스쿨
- 미니프로젝트
- 데이터분석
- KT AIVLE School
- AI트랙
- 관세용어
- kt에이블스쿨7기
- springboot
- Kafka
- kt aivleschool 7기
- Today
- Total
목록Algorithm/Java (8)
Hseong

class Solution { int maxCount = 0; // 최대 던전 수 저장 변수 public int solution(int k, int[][] dungeons) { boolean[] visited = new boolean[dungeons.length]; // 방문 여부 체크 dfs(k, dungeons, visited, 0); // DFS 시작 return maxCount; } private void dfs(int k, int[][] dungeons, boolean[] visited, int count) { // 현재까지 탐험한 던전 수로 최대값 갱신 maxCount = Math.max(maxCount,..

class Solution { public int[] solution(int brown, int yellow) { int[] answer = {}; int total = brown + yellow ; for(int height=3;height해당 문제의 요건을 잘 보면 무조건 가로>= 세로 관계이기 때문에 이를 잡고 조건문을 짜면되고, 잘 생각해보면 yellow 타일이 둘러쌓여있으려면 무조건 height가 3 이상이여야한다일단 전체 타일 갯수를 구한 후에, for 문을 height =3 부터 전체 갯수를 height로 나눈 것보다 작거나 같을 때 까지만 수행한다.그 이유는 가로 * 세로 하면 total 이 나오고, 기본적으로 세로가 ..

import java.util.*;class Solution { public int solution(String numbers) { Set set = new HashSet(); boolean[] visited = new boolean[numbers.length()]; dfs("", numbers, visited, set); int count = 0; for (int num : set) { if (isPrime(num)) { count++; } } return count; } // 모든 숫..

import java.util.*;class Solution { public int[] solution(int[] answers) { int[] user1 = {1, 2, 3, 4, 5}; int[] user2 = {2, 1, 2, 3, 2, 4, 2, 5}; int[] user3 = {3, 3, 1, 1, 2, 2, 4, 4, 5, 5}; int[] scores = new int[3]; for(int i=0;i result = new ArrayList(); for (int i=0;i일단 수포자 1,2,3 의 찍기 패턴을 각각 배열을 만들어서 정의해준다. 여기서 또 파이썬과 다른점은..

import java.util.Arrays;class Solution { public int solution(int[][] sizes) { int answer = 0; int[] width_li = new int[sizes.length]; int[] height_li = new int[sizes.length]; for (int i = 0; i 해당 문제는 n 개의 가로 + 세로 가 주어진 명함 리스트가 주어지면 가로세로 회전을 하면서 최소한으로 다 덮을 수 있는 max 크기를 구해서 최종 넓이로 출력하는 것이 핵심이다.일단 각 명함마다 가로/세로를 담을 정수형 배열을 선언하고, 가로-세로를 비교하여 큰 것은 가로, 작은 ..

import java.util.Arrays;class Solution { public int solution(int[] citations) { int answer = 0; Arrays.sort(citations); int n = citations.length; for(int i=0;i= h) { return h; } } // 3. 조건을 만족하는 h가 없으면 0 return 0; }}[3,0,6,1,5] 의 int 형 배열을 받고난 후에 Arrays.sort() 문을 통해서 오름차순 정렬을 시킨다.int ..