울음참고 개발공부
코딩 기초 트레이닝 > 이어 붙인 수 - Java

https://school.programmers.co.kr/learn/courses/30/lessons/181928 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 짝수인 경우와 홀수인 경우를 나눔 StringBuilder 를 사용하여 문자열을 저장하고 toString() 으로 전환 Integer.parseInt() 를 사용하여 정수로 바꿔주고 마지막에 짝수값 + 홀수값 class Solution { public int solution(int[] num_list) { StringBuilder evenSb = new StringBuilder(); String..

코딩 기초 트레이닝 > 원소들의 곱과 합 Java

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

코딩 기초 트레이닝 > 주사위 게임 2 Java

class Solution { public int solution(int a, int b, int c) { int answer = 0; int answer1 = a+b+c; int answer2 = (a*a + b*b + c*c); int answer3 = (a*a*a + b*b*b + c*c*c); if(a==b) { if(b==c){ answer = answer1 * answer2 * answer3; } else { answer = answer1 * answer2; } } else if (b==c) { if(a==c) { answer = answer1 * answer2 * answer3; } else { answer = answer1 * answer2; } } else if(a==c){ if(a==b..

코딩 기초 트레이닝 > 코드 처리하기 Java

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

article thumbnail
코딩테스트 입문 > 아이스 아메리카노

class Solution { public int[] solution(int money) { int[] answer = new int[2]; int icedCoffee = 5500; answer[0] = money/icedCoffee; answer[1] = money%icedCoffee; return answer; } }

article thumbnail
코딩테스트 입문 > 피자 나눠 먹기 (1)

피자 조각이 7개 ! 사람이 7 명일 때는 1판 필요하고, 14판일 때는 2판 ... 8 명일 때는 2판이 필요하다. n이 7의 배수일 때는 n / 7 , 아닐 때는 ( n / 7 ) + 1 이 된다. 나머지 연산자를 이용 class Solution { public int solution(int n) { int answer = 0; if ( n % 7 == 0 ) { answer = n / 7 ; }else { answer = ( n / 7 ) + 1; } return answer; } }