알고리즘/프로그래머스 1단계42 [프로그래머스] 문자열 내 마음대로 정렬하기 프로그래머스 1단계 문자열 내 마음대로 정렬하기 https://programmers.co.kr/learn/challenges 문제 설명 풀이 import java.util.*; class Solution { public String[] solution(String[] strings, int n) { String[] answer = new String[strings.length]; for(int i=0; i 2022. 4. 25. [프로그래머스] 나누어 떨어지는 숫자 배열 프로그래머스 1단계 나누어 떨어지는 숫자 배열 https://programmers.co.kr/learn/challenges 문제 설명 풀이 import java.util.*; class Solution { public int[] solution(int[] arr, int divisor) { ArrayList answerList = new ArrayList(); for(int i=0; i 2022. 4. 25. [프로그래머스] 예산 프로그래머스 1단계 예산 https://programmers.co.kr/learn/challenges 문제 설명 풀이 import java.util.Arrays; class Solution { public int solution(int[] d, int budget) { int answer = 0; Arrays.sort(d); for (int i = 0; i= 0) { budget-=d[i]; answer++; } else { break; } } return answer; } } 2022. 4. 24. [프로그래머스] 모의고사 프로그래머스 1단계 모의고사 https://programmers.co.kr/learn/challenges 문제 설명 풀이 import java.util.*; import java.lang.*; class Solution { public int[] solution(int[] answers) { int student1[] = {1, 2, 3, 4, 5}; int student2[] = {2, 1, 2, 3, 2, 4, 2, 5}; int student3[] = {3, 3, 1, 1, 2, 2, 4, 4, 5, 5}; ArrayList topStudent = new ArrayList(); int score[] = new int[3]; for(int i=0; i 2022. 4. 24. 이전 1 2 3 4 5 6 7 ··· 11 다음