Algorithm Study71 프로그래머스 Lv_2_구명보트_Java https://school.programmers.co.kr/learn/courses/30/lessons/42885?language=java 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr import java.util.*;class Solution { public int solution(int[] people, int limit) { int answer = 0; Arrays.sort(people); int index = 0; for (int i = people.length - 1; i >= .. 2024. 7. 9. 프로그래머스 Lv2_점프와 순간 이동_Java https://school.programmers.co.kr/learn/courses/30/lessons/12980?language=java 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr import java.util.*;public class Solution { public int solution(int n) { int ans = 0; if(n == 1) { ans = 1; } else { while(n > 0) { if(n % 2 ==.. 2024. 7. 8. 프로그래머스 Lv3_단속카메라_Java https://school.programmers.co.kr/learn/courses/30/lessons/42884 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr import java.util.*;class Solution { public int solution(int[][] routes) { // 차량의 이탈 지점을 기준으로 오름차순 정렬 Arrays.sort(routes, (o1, o2) -> o1[1] - o2[1]); // 첫 번째 카메라를 첫 번째 차량의 이탈 지점에 설치 int location.. 2024. 7. 7. 프로그래머스 Lv3_최고의 집합_Java https://school.programmers.co.kr/learn/courses/30/lessons/12938 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr import java.util.*;class Solution { public int[] solution(int n, int s) { int[] answer = new int[n]; if (n > s) { return new int[]{-1}; } int share = s / n; int.. 2024. 6. 27. 프로그래머스 Lv3_단어 변환_Java https://school.programmers.co.kr/learn/courses/30/lessons/43163?language=java 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr import java.util.*;class Solution { private String begin; private String target; private String[] words; private boolean[] visited; private int answer; public int solution(String begin, Str.. 2024. 6. 27. 프로그래머스 Lv3_야근 지수_Java https://school.programmers.co.kr/learn/courses/30/lessons/12927 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr import java.util.*;class Solution { public long solution(int n, int[] works) { long answer = 0; PriorityQueue pq = new PriorityQueue(Collections.reverseOrder()); // 오름차순 for(int i : works) { .. 2024. 6. 26. 프로그래머스 Lv3_이중우선순위큐_Java https://school.programmers.co.kr/learn/courses/30/lessons/42628?language=java 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr import java.util.*;class Solution { public int[] solution(String[] operations) { int[] answer = {}; PriorityQueue pq = new PriorityQueue(); // 오름차순 PriorityQueue reversePq = new PriorityQ.. 2024. 6. 26. 프로그래머스 Lv2_올바른 괄호_Java https://school.programmers.co.kr/learn/courses/30/lessons/12909?language=java 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr import java.util.*;import java.io.*;class Solution { boolean solution(String s) { boolean answer = true; Stack stack = new Stack(); for(int i = 0; i 풀이- stack을 활용하여 "("일시.. 2024. 6. 25. 이전 1 2 3 4 ··· 9 다음