분류 전체보기

코딩테스트/코딩테스트 문제풀이

[Java] 프로그래머스 <귤 고르기>

https://school.programmers.co.kr/learn/courses/30/lessons/138476 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr import java.util.*;class Solution { public int solution(int k, int[] tangerine) { int answer = 0; int n = tangerine.length; Arrays.sort(tangerine); Stack stack = new Stack(); for(int i = 0; i = 0..

코딩테스트/코딩테스트 문제풀이

[Java] 프로그래머스 <K번째수>

https://school.programmers.co.kr/learn/courses/30/lessons/42748 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr - 첫 번째 풀이 (배열을 직접 자름)import java.util.*;class Solution { public int[] solution(int[] array, int[][] commands) { int[] answer = new int[commands.length]; for(int i = 0; i  - 두 번째 풀이 (배열을 함수를 이용해 자름)import java.util.*;class Sol..

코딩테스트/코딩테스트 문제풀이

[Java] 프로그래머스 <폰켓몬>

https://school.programmers.co.kr/learn/courses/30/lessons/1845 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr import java.util.*;class Solution { public int solution(int[] nums) { int answer = 0; int max = nums.length/2; HashSet numsSet = new HashSet(); for(int n : nums){ numsSet.add(n); ..

코딩테스트/코딩테스트 문제풀이

[Java] 프로그래머스 <같은 숫자는 싫어>

https://school.programmers.co.kr/learn/courses/30/lessons/12906 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr  import java.util.*;public class Solution { public int[] solution(int []arr) { Stack stack = new Stack(); for(int i : arr){ if(stack.empty() || !stack.peek().equals(i)){ stack.push(i); } ..

Yang Ji Woo
'분류 전체보기' 카테고리의 글 목록 (36 Page)