본문 바로가기

알고리즘/카카오

(27)
[프로그래머스] 이모티콘 할인행사 https://school.programmers.co.kr/learn/courses/30/lessons/150368 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr public class Solution { static int[] sales_per = { 40, 30, 20, 10 }; static int[] temp; static int N, M, maxMember, maxMoney; public static void main(String[] args) { //int[][] users = { { 40, 10000 }, { 25, 10000 } }; //i..
[프로그래머스] 파괴되지 않은 건물 https://school.programmers.co.kr/learn/courses/30/lessons/92344 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr class Solution { public int solution(int[][] board, int[][] skill) { int N = board.length; int M = board[0].length; int[][] newBoard = new int[N+1][M+1]; for(int i=0; i
[프로그래머스] 두 큐 합 같게 만들기 https://school.programmers.co.kr/learn/courses/30/lessons/118667 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr public static int solution(int[] queue1, int[] queue2) { long sum1 = 0; long sum2 = 0; long sum = 0; Deque q1 = new ArrayDeque(); Deque q2 = new ArrayDeque(); for(int i=0; i
[프로그래머스] 행렬 테두리 회전하기 https://school.programmers.co.kr/learn/courses/30/lessons/77485 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; public class Solution { static int[][] map; static ArrayList list = new ArrayList(); public static int[] solution(int rows, int columns, int..
[프로그래머스] k진수에서 소수 개수 구하기 https://school.programmers.co.kr/learn/courses/30/lessons/92335 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr public class Solution { public static int solution(int n, int k) { int answer = 0; // 10진수 -> k 진수로 변환 String radix = Integer.toString(n, k); // System.out.println(radix); String[] strArr = radix.split("0"); // 0으로 split 한 ..
[프로그래머스] 양궁대회 https://school.programmers.co.kr/learn/courses/30/lessons/92342 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.Arrays; public class Solution { static int[] answer = {-1}; static int[] lion = new int[11]; static int max = -1; public static int[] solution(int n, int[] info) { arrow(info, n); // System.out.println(Arra..
[프로그래머스] 주차 요금 계산 https://school.programmers.co.kr/learn/courses/30/lessons/92341 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map.Entry; public class Solution { static int..
2021 KAKAO BLIND RECRUITMENT - 메뉴 리뉴얼 https://programmers.co.kr/learn/courses/30/lessons/72411 코딩테스트 연습 - 메뉴 리뉴얼 레스토랑을 운영하던 스카피는 코로나19로 인한 불경기를 극복하고자 메뉴를 새로 구성하려고 고민하고 있습니다. 기존에는 단품으로만 제공하던 메뉴를 조합해서 코스요리 형태로 재구성해서 programmers.co.kr import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map.Entry; public class So..