프로그래머스

    [프로그래머스, 181928] 이어 붙인 수 (java)

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

    [프로그래머스, 120866] 안전지대 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/120866 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 87.6 MB, 시간: 0.10 ms사용 알고리즘: 그래프 탐색class Solution { public int solution(int[][] board) { int answer = (int) Math.pow(board.length, 2); // 위험 구역 boolean[][] danger = new boolean[board.length][board.length];..

    [프로그래머스, 181849] 문자열 정수의 합 (java)

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

    [프로그래머스, 181851] 전국 대회 선발 고사 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181851 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 71 MB, 시간: 1.89 ms사용 알고리즘: 정렬import java.util.*;class Solution { public int solution(int[] rank, boolean[] attendance) { // 참석 가능한 학생들의 번호와 랭크를 담는 리스트 List list = new ArrayList(); for(int i = 0; i o1[1] -..

    [프로그래머스, 181852] 뒤에서 5등 위로 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181852 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 89 MB, 시간: 0.51 ms사용 알고리즘: 정렬import java.util.*;class Solution { public int[] solution(int[] num_list) { // num_list 정렬 Arrays.sort(num_list); int[] answer = new int[num_list.length - 5]; for(int i ..

    [프로그래머스, 86971] 전력망을 둘로 나누기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/86971 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 83.5 MB, 시간: 0.28 ms사용 알고리즘: 완전탐색import java.util.*;class Solution { int answer, n; List> edges; boolean[] visited; public int solution(int n, int[][] wires) { this.n = n; // 최소값을 구하기 위해 최대값을 저장해둠..

    [프로그래머스, 77484] 로또의 최고 순위와 최저 순위 (java)

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

    [프로그래머스, 181853] 뒤에서 5등까지 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181853 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 88.2 MB, 시간: 0.50 ms사용 알고리즘: 구현import java.util.*;class Solution { public int[] solution(int[] num_list) { // 정렬 Arrays.sort(num_list); // 가장 작은 5개 담기 int[] answer = new int[5]; for(int i = 0..

    [프로그래머스, 181854] 배열의 길이에 따라 다른 연산하기 (java)

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

    [프로그래머스, 181855] 문자열 묶기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181855 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 125 MB, 시간: 25.73 ms사용 알고리즘: 자료구조import java.util.*;class Solution { public int solution(String[] strArr) { int answer = 0; // key := 문자열 길이 // value := 개수 Map map = new HashMap(); in..