전체 글

전체 글

    [프로그래머스, 181915] 글자 이어 붙여 문자열 만들기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181915 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 92.4 MB, 시간: 0.14 ms사용 알고리즘: 문자열class Solution { public String solution(String my_string, int[] index_list) { StringBuilder answer = new StringBuilder(); for(int i : index_list) answer.append(my_string..

    [프로그래머스, 181916] 주사위 게임 3 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181916 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 77.8 MB, 시간: 0.14 ms사용 알고리즘: 자료구조import java.util.*;class Solution { public int solution(int a, int b, int c, int d) { Map map = new HashMap(); map.put(a, 1); map.put(b, map.getOrDefault(b, 0) + 1); map.put..

    [프로그래머스, 181836] 그림 확대 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181836 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 77.3 MB, 시간: 0.59 ms사용 알고리즘: 구현class Solution { public String[] solution(String[] picture, int k) { String[] answer = new String[picture.length * k]; StringBuilder tmp; for(int i = 0; i

    [프로그래머스, 181918] 배열 만들기 4 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181918 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 98.8 MB, 시간: 24.18 ms사용 알고리즘: 자료구조import java.util.*;class Solution { public int[] solution(int[] arr) { // 스택으로 사용할 덱 Deque stack = new ArrayDeque(); // 스택 자료구조를 사용해 작업 수행 int idx = 0; while..

    [프로그래머스, 181919] 콜라츠 수열 만들기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181919 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 72.5 MB, 시간: 0.15 ms사용 알고리즘: 구현import java.util.*;class Solution { public int[] solution(int n) { List list = new ArrayList(); list.add(n); while(n != 1) { if(n % 2 == 0) n /= 2; else..

    [프로그래머스, 181920] 카운트 업 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181920 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 78.3 MB, 시간: 0.03 ms사용 알고리즘: 구현class Solution { public int[] solution(int start_num, int end_num) { int[] answer = new int[end_num - start_num + 1]; for(int i = 0; i

    [프로그래머스, 181884] n보다 커질 때까지 더하기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181884 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 86.9 MB, 시간: 0.02 ms사용 알고리즘: 구현class Solution { public int solution(int[] numbers, int n) { int answer = 0; for(int i = 0; i n) return answer; } return answer; }}

    [프로그래머스, 181874] A 강조하기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181874 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 74.7 MB, 시간: 0.04 ms사용 알고리즘: 문자열import java.util.*;class Solution { public String solution(String myString) { StringBuilder answer = new StringBuilder(); for(int i = 0; i = 'B' && myString.charAt(i)

    [프로그래머스, 181890] 왼쪽 오른쪽 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181890 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 90.3 MB, 시간: 0.04 ms사용 알고리즘: 구현import java.util.*;class Solution { public String[] solution(String[] str_list) { for(int i = 0; i

    [프로그래머스, 181921] 배열 만들기 2 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181921 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 82.6 MB, 시간: 6.47 ms사용 알고리즘: 구현import java.util.*;class Solution { public int[] solution(int l, int r) { // 정답을 임시로 담을 리스트 List list = new ArrayList(); for(int i = l % 5 == 0 ? l : (l / 5 + 1) * 5; i 0) {..