Problem Solving

Problem Solving

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

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

    [프로그래머스, 181896] 첫 번째로 나오는 음수 (java)

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

    [프로그래머스, 181897] 리스트 자르기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181897 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 85.4 MB, 시간: 0.05 ms사용 알고리즘: 구현import java.util.*;class Solution { public int[] solution(int n, int[] slicer, int[] num_list) { int a = slicer[0], b = slicer[1], c = slicer[2]; int[] answer; if(n =..

    [프로그래머스, 181863] rny_string (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181863 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 82.1 MB, 시간: 0.09 ms사용 알고리즘: 구현class Solution { public String solution(String rny_string) { StringBuilder answer = new StringBuilder(); for(char c : rny_string.toCharArray()) { if(c == 'm') answer.appe..

    [프로그래머스, 181856] 배열 비교하기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181856 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 85.2 MB, 시간: 0.04 ms사용 알고리즘: 구현class Solution { public int solution(int[] arr1, int[] arr2) { if(arr1.length > arr2.length) return 1; else if(arr1.length == arr2.length) { int sum1 = sum(arr1); int ..

    [프로그래머스, 181832] 정수를 나선형으로 배치하기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181832 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 82.1 MB, 시간: 0.09 ms사용 알고리즘: 구현, 사방탐색class Solution { public int[][] solution(int n) { int[][] answer = new int[n][n]; // 우하좌상 int[] dx = new int[] {0, 1, 0, -1}; int[] dy = new int[] {1, 0, -1, 0};..

    [프로그래머스, 181842] 부분 문자열 (java)

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

    [프로그래머스, 181898] 가까운 1 찾기 (java)

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

    [프로그래머스, 181899] 카운트 다운 (java)

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

    [프로그래머스, 181900] 글자 지우기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181900 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 91.4 MB, 시간: 0.06 ms사용 알고리즘: 구현class Solution { public String solution(String my_string, int[] indices) { // 지울 인덱스 boolean[] delete = new boolean[my_string.length()]; for(int i : indices) delete[i] = true; ..