https://school.programmers.co.kr/learn/courses/30/lessons/120847 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 import java.util.Arrays; class Solution { public int solution(int[] numbers) { Arrays.sort(numbers); int answer = numbers[numbers.length-1] * numbers[numbers.length-2]; return answer; } }
https://school.programmers.co.kr/learn/courses/30/lessons/120889 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 import java.util.Arrays; class Solution { public int solution(int[] sides) { Arrays.sort(sides); if (sides[0] + sides[1] = sides[0]+sides[1] ? 2 : 1; } } 이런 간단한 조건문은 삼항 연산자를 쓰면 더 깔끔해보이는 거 같다.
https://school.programmers.co.kr/learn/courses/30/lessons/120836 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int solution(int n) { int answer = 0; for (int i = 1; i n % i == 0).count(); } } 이렇게 푸는 사람도 있구나..
https://school.programmers.co.kr/learn/courses/30/lessons/120825 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public String solution(String my_string, int n) { StringBuilder sb = new StringBuilder(); char[] arr = my_string.toCharArray(); for(int i = 0; i < my_string.length(); i ++){ sb.append(String.valueOf(..
https://school.programmers.co.kr/learn/courses/30/lessons/120826 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public String solution(String my_string, String letter) { String answer = my_string.replace(letter, ""); return answer; } }
https://school.programmers.co.kr/learn/courses/30/lessons/120816 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int solution(int slice, int n) { int tmp = 0; if (n % slice == 0) tmp = 0; else tmp = 1; int answer = n / slice + tmp; return answer; } } 다른 풀이 class Solution { public int solution(int slice, ..
https://school.programmers.co.kr/learn/courses/30/lessons/120585 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int solution(int[] array, int height) { int answer = 0; for (int h : array){ if (h > height) answer++; } return answer; } }
https://school.programmers.co.kr/learn/courses/30/lessons/120833 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int[] solution(int[] numbers, int num1, int num2) { int[] answer = new int[num2 - num1 + 1]; int idx = 0; for (int i = num1; i
https://school.programmers.co.kr/learn/courses/30/lessons/120824 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int[] solution(int[] num_list) { int a = 0, b = 0; for (int i = 0; i < num_list.length; i++){ if (num_list[i] % 2 == 0) a += 1; else b += 1; } int[] answer = {a, b}; return answer; } } 다른 풀이 c..