https://school.programmers.co.kr/learn/courses/30/lessons/120840 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int solution(int balls, int share) { return combination(balls, share); } public static int combination(int balls, int share) { if (balls == share || share == 0) return 1; return combination((b..
https://school.programmers.co.kr/learn/courses/30/lessons/120902 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int solution(String my_string) { int answer; String[] arr = my_string.split(" "); for (int i = 0; i < arr.length; i++) { if (arr[i].equals("+")) { arr[i+1] = String.valueOf(Integer.parseInt(ar..
https://school.programmers.co.kr/learn/courses/30/lessons/120913 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 import java.util.ArrayList; import java.util.Arrays; import java.util.List; class Solution { public String[] solution(String my_str, int n) { List answer = new ArrayList(); for (int i = 0; i < (my_str.length() / n); ..
https://school.programmers.co.kr/learn/courses/30/lessons/120894 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 import java.util.HashMap; import java.util.Map; class Solution { public long solution(String numbers) { long answer; Map dict = new HashMap(){{ put("zero", "0"); put("one", "1"); put("two", "2"); put("three", "3"); p..
https://school.programmers.co.kr/learn/courses/30/lessons/120912 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 import java.util.Arrays; class Solution{ public int solution(int[] array){ int answer = 0; String str = Arrays.toString(array); for(int i = 0; i < str.length(); i++){ if(str.charAt(i) == '7'){ answer++; } } return an..
https://school.programmers.co.kr/learn/courses/30/lessons/120843 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 import java.util.LinkedList; import java.util.Queue; class Solution { public int solution(int[] numbers, int k) { int answer = 0; Queue q = new LinkedList(); for (int num : numbers) q.offer(num); for (int i = 0; i < ..
https://school.programmers.co.kr/learn/courses/30/lessons/120852 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 import java.util.*; class Solution { public int[] solution(int n) { int[] answer = {}; List list = new ArrayList(); int i = 2; while (n >= 2) { if (n % i == 0) { list.add(i); n /= i; } else { i++; } } answer = list.s..
https://school.programmers.co.kr/learn/courses/30/lessons/120853 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public int solution(String s) { int answer = 0; String[] arr = s.split(" "); for (int i = 0; i < arr.length; i++) { if (arr[i].equals("Z")) { answer -= Integer.parseInt(arr[i-1]); continue; } answer ..
https://school.programmers.co.kr/learn/courses/30/lessons/120885 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 class Solution { public String solution(String bin1, String bin2) { return Integer.toBinaryString(Integer.parseInt(bin1,2)+Integer.parseInt(bin2,2)); } } 10진수 → 2진수 Integer.toBinaryString 2진수 → 10진수 String bin1 Integ..
https://school.programmers.co.kr/learn/courses/30/lessons/87377 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 import java.util.Arrays; import java.util.HashSet; // 교점에 별 만들기 class Solution { public String[] solution(int[][] line) { // 무한한 grid 의 범위를 제한하기 위한 최대, 최소값 long maxX = Long.MIN_VALUE; long maxY = Long.MIN_VALUE; long ..