분류 전체보기 795

프로그래머스 암호 해독 (JAVA)

https://school.programmers.co.kr/learn/courses/30/lessons/120892 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr class Solution { public String solution(String cipher, int code) { String answer = ""; StringBuilder sb = new StringBuilder(); for(int i = code-1 ; i < cipher.length() ; i += code){ sb.append(cipher.charAt(i)); } answer = ..

알고리즘 2022.11.20

프로그래머스 369게임 (JAVA)

https://school.programmers.co.kr/learn/courses/30/lessons/120891 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr class Solution { public int solution(int order) { int answer = 0; String temp = Integer.toString(order); for(int i = 0 ; i < temp.length() ; i++){ char ch = temp.charAt(i); if(ch == '3' || ch == '6' || ch == '9'){ answer++..

알고리즘 2022.11.18

프로그래머스 주사위의 개수 (JAVA)

https://school.programmers.co.kr/learn/courses/30/lessons/120845 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr class Solution { public int solution(int[] box, int n) { int answer = (box[0]/n) * (box[1]/n) * (box[2]/n); return answer; } }

알고리즘 2022.11.17

프로그래머스 양꼬치 (JAVA)

https://school.programmers.co.kr/learn/courses/30/lessons/120830 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr class Solution { private static final int LAMB_PRICE = 12_000; private static final int DRINK_PRICE = 2_000; public int solution(int n, int k) { int answer = LAMB_PRICE * n + DRINK_PRICE * Math.max(k - n / 10,0); return an..

알고리즘 2022.11.16

프로그래머스 피자 나눠 먹기 (JAVA)

https://school.programmers.co.kr/learn/courses/30/lessons/120814 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr class Solution { public int solution(int n) { int answer = 0; answer = n / 7; if(answer * 7 < n){ answer++; } return answer; } }

알고리즘 2022.11.14

프로그래머스 7의 개수 (JAVA)

https://school.programmers.co.kr/learn/courses/30/lessons/120912 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr class Solution { public int solution(int[] array) { int answer = 0; for(int num : array){ answer += cal(num); } return answer; } private int cal(int num){ int result = 0; while(num > 0){ if(num % 10 == 7){ result++; } num ..

알고리즘 2022.11.13

프로그래머스 문자 제거하기 (JAVA)

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 = ""; StringBuilder sb = new StringBuilder(); for(int i = 0 ; i < my_string.length(); i++){ if(letter.charAt(0) == my_string.charAt(i..

알고리즘 2022.11.12

프로그래머스 컨트롤 제트 (JAVA)

https://school.programmers.co.kr/learn/courses/30/lessons/120853 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.*; class Solution { public int solution(String s) { int answer = 0; String[] temp = s.split(" "); int sum = 0; boolean[] isNum = new boolean[temp.length]; for(int i = 0 ; i < temp.length ; i++){ if("Z".equ..

알고리즘 2022.11.11