본문 바로가기

Algorithm/프로그래머스 코딩테스트 문제풀이전략36

[프로그래머스] Lv.2 게임 맵 최단 거리 https://school.programmers.co.kr/learn/courses/30/lessons/1844BFS 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr 사용 알고리즘BFS풀이import java.util.*;class Solution { static int [] dx = {1,0,-1,0}; static int [] dy = {0,1,0,-1}; public int solution(int[][] maps) { int n = maps.length; int m = maps[0].length; int [][] .. 2024. 6. 3.
[프로그래머스] Lv.3 단어 변환 https://school.programmers.co.kr/learn/courses/30/lessons/43163/ 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr 사용 알고리즘BFSDFS풀이BFS를 사용한 풀이 import java.util.*;class Solution { public int solution(String begin, String target, String[] words) { int answer = 0; boolean [] visited = new boolean[words.length]; Qu.. 2024. 6. 3.
[프로그래머스] Lv.2 기능개발 https://school.programmers.co.kr/learn/courses/30/lessons/42586 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr  사용 알고리즘배열 큐풀이 import java.util.*;class Solution { public int[] solution(int[] progresses, int[] speeds) { int [] complete = new int[progresses.length]; for(int i = 0; i list = new ArrayList(.. 2024. 5. 21.
[프로그래머스] Lv.2 주식 가격 https://school.programmers.co.kr/learn/courses/30/lessons/42584 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr  사용 알고리즘 스택풀이 import java.util.*;class Solution { public int[] solution(int[] prices) { int[] answer = new int[prices.length]; // 1. 다음 값이 현재 값보다 작을 때 // 2. 다음 값이 현재 값보다 클 때 -> .. 2024. 5. 18.