헝D의 일기장
[프로그래머스] 뒤에 있는 큰 수 찾기 java (LEVEL2)
코테풀이 2023. 5. 11. 19:56

https://school.programmers.co.kr/learn/courses/30/lessons/154539 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의풀이 import java.util.*; class Solution { public int[] solution(int[] numbers) { int[] answer = new int[numbers.length]; Arrays.fill(answer, -1); for(int i=numbers.length-2; i>=0; i--){ for(int j=i+1; j

[프로그래머스] 연속 부분 수열 합의 개수 java (LEVEL2)
코테풀이 2023. 5. 11. 19:00

https://school.programmers.co.kr/learn/courses/30/lessons/131701 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의풀이 import java.util.*; class Solution { public int solution(int[] elements) { Set set = new HashSet(); int s=elements.length; for(int i=0; i

[프로그래머스] 네트워크 java (LEVEL3)
코테풀이 2023. 4. 30. 15:38

https://school.programmers.co.kr/learn/courses/30/lessons/43162 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr class Solution { static boolean[] visited; static int len=0; static int answer = 0; public void dfs(int start ,int[][] computers){ for(int i=0; i

[프로그래머스] 게임 맵 최단거리 java (LEVEL2)
코테풀이 2023. 4. 30. 15:37

https://school.programmers.co.kr/learn/courses/30/lessons/1844 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의풀이 import java.util.*; class Solution { static int dx[]={-1, 1, 0, 0}; static int dy[]={0, 0, -1, 1}; static int answer = 0; static boolean[][] visited; static int xlen, ylen; public class Node{ int x, y, cost; Node(int x,..

[프로그래머스] 피로도 java (LEVEL2)
코테풀이 2023. 4. 30. 15:34

https://school.programmers.co.kr/learn/courses/30/lessons/87946 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의풀이 class Solution { static boolean[] visited; static int answer=0; public int solution(int k, int[][] dungeons) { visited= new boolean[dungeons.length]; dfs(0, k, dungeons); return answer; } public void dfs(int depth, int..

[프로그래머스] 전력망을 둘로 나누기 java (LEVEL2)
코테풀이 2023. 4. 30. 15:33

https://school.programmers.co.kr/learn/courses/30/lessons/86971 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의풀이 import java.util.*; class Solution { static int[][]map; public int solution(int n, int[][] wires) { int answer = n; map = new int[n+1][n+1]; for(int i = 0;i

[프로그래머스] 모음사전 java 자바 (LEVEL2)
코테풀이 2023. 4. 30. 15:31

https://school.programmers.co.kr/learn/courses/30/lessons/84512 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.*; class Solution { static char[]alph = {'A','E','I','O','U'}; static List list; public int solution(String word) { list= new ArrayList(); combination(0,""); Collections.sort(list); return list.indexOf(word..

[프로그래머스] 전화번호 목록 java 자바 (LEVEL2)
코테풀이 2023. 4. 30. 15:28

https://school.programmers.co.kr/learn/courses/30/lessons/42577 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 1.나의풀이 import java.util.*; class Solution { public boolean solution(String[] phone_book) { boolean answer = true; //반드시 정렬 필요 Arrays.sort(phone_book); for(int k=0; k

[프로그래머스] 의상 java 자바(LEVEL2)
코테풀이 2023. 4. 30. 15:26

https://school.programmers.co.kr/learn/courses/30/lessons/42578 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의풀이 import java.util.*; class Solution { public int solution(String[][] clothes) { int answer = 1; Map m = new HashMap(); for(int i=0; i

[프로그래머스] 달리기 경주 java 풀이(level1)
코테풀이 2023. 4. 20. 21:09

https://school.programmers.co.kr/learn/courses/30/lessons/178871 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의풀이 import java.util.*; class Solution { public String[] solution(String[] players, String[] callings) { String[] answer = new String[players.length]; //key로 접근을 용이하게 하기 위해 map 2개 사용 Map map = new HashMap();//등수, 선수 Map m..