프로그래머스

    [프로그래머스, 42578] 의상 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/42578 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr메모리: 79.7 MB, 시간: 0.11 ms사용 알고리즘: 해시 맵import java.util.*;class Solution { public int solution(String[][] clothes) { Map map = new HashMap(); for(int i = 0; i

    [프로그래머스, 148653] 마법의 엘리베이터 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/148653# 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr메모리: 71 MB, 시간: 0.03 ms사용 알고리즘: 그리디class Solution { public int solution(int storey) { int answer = 0; int temp; while(storey > 0) { temp = storey % 10; storey..

    [프로그래머스, 340200] [PCCE 기출문제] 8번 / 닉네임 규칙 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/340200 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr메모리: 84.9 MB, 시간: 16.69 ms사용 알고리즘: 문자열class Solution { public String solution(String nickname) { String answer = ""; for(int i=0; i 8){ answer = answer.substring(0, 8); } return answe..

    [프로그래머스, 81301] 숫자 문자열과 영단어 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/81301 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr메모리: 72.5 MB, 시간: 0.19 ms사용 알고리즘: 문자열import java.util.*;class Solution { public int solution(String s) { int answer = 0; List numbers = new ArrayList(Arrays.asList("zero", "one", "two", "three"..

    [프로그래머스, 42587] 프로세스 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/42587 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr메모리: 71.7 MB, 시간: 1.48 ms사용 알고리즘: 큐, 덱큐, 우선순위큐import java.util.*;class Solution { public int solution(int[] priorities, int location) { // 인덱스 번호와 우선순위를 담은 배열을 넣을 큐 Deque deque = new ArrayDeque(); ..

    [프로그래머스, 154539] 뒤에 있는 큰 수 찾기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/154539 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr메모리: 204 MB, 시간: 28.85 ms사용 알고리즘: 다이나믹 프로그래밍import java.util.*;class Solution { public int[] solution(int[] numbers) { // numbers의 길이 int n = numbers.length; // 뒷 큰수의 인덱스를 담은 배열 int[] dp..

    [프로그래머스, 1844] 게임 맵 최단거리 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/1844 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr메모리: 53.9 MB, 시간: 10.19 ms사용 알고리즘: BFSimport java.util.*;class Solution { public int solution(int[][] maps) { // maps 크기 int n = maps.length; int m = maps[0].length; // 사방탐색 ..

    [프로그래머스, 131127] 할인 행사 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/131127# 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr메모리: 125 MB, 시간: 22.19 ms사용 알고리즘: 해시맵, 자료구조, 누적합import java.util.*;class Solution { public int solution(String[] want, int[] number, String[] discount) { int answer = 0; Map wantInfo = new Ha..

    [프로그래머스, 42889] 실패율 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/42889 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr메모리: 93.2 MB, 시간: 5.17 ms사용 알고리즘: 누적합, 정렬 import java.util.*;class Solution { public int[] solution(int N, int[] stages) { // 누적합으로 스테이지에 도착한 인원수 저장할 배열 int[] sum = new int[N + 2]; /..

    [프로그래머스, 43165] 타겟 넘버 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/43165 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr메모리: 74.3 MB, 시간: 6.12 ms사용 알고리즘: DFS class Solution { static int[] numbers; static int target; static int answer; public int solution(int[] numbers, int target) { this.numbers = numbers; ..