
# 주사위 게임 2 2023.07.18 - [코테연습/프로그래머스] - 코딩 기초 트레이닝 > 주사위 게임 2 Java 코딩 기초 트레이닝 > 주사위 게임 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 * megak.tistory.com # 주사위 게임 3 https://school.prog..
프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 말 그대로 간단한 논리 연산에 관한문제 논리 연산 '|| (or)' 과 '&& (and)' 의 개념을 알고있는지 확인하는 문제이다. class Solution { public boolean solution(boolean x1, boolean x2, boolean x3, boolean x4) { return (x1 || x2) && (x3 || x4); } }

프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.*; class Solution { public int[] solution(int n) { ArrayList answerArray = new ArrayList(); while(n!=1){ if(n%2==0){ answerArray.add(n); n /= 2; }else{ answerArray.add(n); n = 3 * n + 1; } } answerArray.add(1); int[] answer = new int[answerArray.size()]; for(int i=0; i
프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.ArrayList; class Solution { public int[] solution(int[] arr) { ArrayList stkList = new ArrayList(); int i = 0; while (i < arr.length) { if (stkList.isEmpty()) { stkList.add(arr[i]); i++; } else if (stkList.get(stkList.size() - 1) < arr[i]) { stkList.add(arr[i]); i++; } ..

프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.ArrayList; import java.util.Arrays; class Solution { public int[] solution(int l, int r) { ArrayList resultList = new ArrayList(); for (int i = l; i
https://school.programmers.co.kr/learn/courses/30/lessons/181920 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr class Solution { public int[] solution(int start, int end) { int[] answer = new int[end-start+1 ]; for(int i=0; i
프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr class Solution { public int[] solution(int[] arr, int[][] queries) { for (int i=0; i
프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 방법 1) 직관적으로 바로 풀기 class Solution { public int[] solution(int[] arr, int[][] queries) { int a,b,temp; for(int i=0; i