https://school.programmers.co.kr/learn/courses/30/lessons/12932 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 import java.util.ArrayList; import java.util.Arrays; import java.util.List; class Solution { public int[] solution(long n) { String[] s = String.valueOf(n).split(""); List list = new ArrayList(); for (int i = s.length..
https://school.programmers.co.kr/learn/courses/30/lessons/12916 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { boolean solution(String s) { s = s.toLowerCase(); int a = 0; int b = 0; for (char c : s.toCharArray()) { if (c == 'p') a++; if (c == 'y') b++; } return a == b; } } 다른 풀이 class Solution { boolean solut..
https://school.programmers.co.kr/learn/courses/30/lessons/12954 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 import java.util.ArrayList; import java.util.List; class Solution { public long[] solution(int x, int n) { List list = new ArrayList(); for (int i = 1; i < n+1; i++) { list.add((long)x*i); } return list.stream().mapTo..
https://school.programmers.co.kr/learn/courses/30/lessons/87389 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int solution(int n) { int answer = 1; do { answer++; } while (n % answer != 1); return answer; } }
https://school.programmers.co.kr/learn/courses/30/lessons/12928 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int solution(int n) { int answer = 0; for (int i = 1; i
https://school.programmers.co.kr/learn/courses/30/lessons/12944 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public double solution(int[] arr) { double answer = 0; for (int i : arr) answer += i; return answer / arr.length; } } 다른 풀이 import java.util.*; import java.lang.*; class Solution { public double solut..
https://school.programmers.co.kr/learn/courses/30/lessons/12931 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int solution(int n) { int answer = 0; char[] chars = String.valueOf(n).toCharArray(); for (char c : chars){ answer += Integer.parseInt(String.valueOf(c)); } return answer; } } 다른 풀이 import java..
https://school.programmers.co.kr/learn/courses/30/lessons/12937 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public String solution(int num) { if (num % 2 == 0) return "Even"; return "Odd"; } }
https://school.programmers.co.kr/learn/courses/30/lessons/120956 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 import java.util.ArrayList; import java.util.List; class Solution { public int solution(String[] babbling) { int answer = 0; List list = new ArrayList(){ { add("aya"); add("ye"); add("woo"); add("ma"); } }; for (int ..
https://school.programmers.co.kr/learn/courses/30/lessons/120875 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int solution(int[][] dots) { int x1 = dots[0][0]; int y1 = dots[0][1]; int x2 = dots[1][0]; int y2 = dots[1][1]; int x3 = dots[2][0]; int y3 = dots[2][1]; int x4 = dots[3][0]; int y4 = dots[3]..