프로그래머스

    [프로그래머스, 120863] 다항식 더하기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/120863 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 79.6 MB, 시간: 18.75 ms사용 알고리즘: 문자열import java.util.*;class Solution { public String solution(String polynomial) { // +를 기준으로 문자열 자르기 StringTokenizer st = new StringTokenizer(polynomial, "+ "); // x의 개수 ..

    [프로그래머스, 181843] 부분 문자열인지 확인하기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181843 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 70 MB, 시간: 0.05 ms사용 알고리즘: 문자열class Solution { public int solution(String my_string, String target) { // target 문자열이 더 길다면 // target은 my_string의 부분 문자열이 아니다 if(target.length() > my_string.length()) retu..

    [프로그래머스, 181844] 배열의 원소 삭제하기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181844 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 88.5 MB, 시간: 0.14 ms사용 알고리즘: 자료구조import java.util.*;class Solution { public int[] solution(int[] arr, int[] delete_list) { // delete_list의 모든 원소를 담는다 HashSet set = new HashSet(); for(int d : delete_list) ..

    [프로그래머스, 181846] 두 수의 합 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181846 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 96.9 MB, 시간: 18.28 ms사용 알고리즘: 문자열class Solution { public String solution(String a, String b) { // a와 b 뒤집어 저장 a = new StringBuilder(a).reverse().toString(); b = new StringBuilder(b).reverse().toString(); ..

    [프로그래머스, 120882] 등수 매기기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/120882 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 87.8 MB, 시간: 0.76 ms사용 알고리즘: 정렬import java.util.*;class Solution { public int[] solution(int[][] score) { // (영어 점수 + 수학 점수)와 학생 번호를 담은 배열 int[][] arr = new int[score.length][2]; for(int i = 0; i o2[0] - o1[0]); ..

    [프로그래머스, 120868] 삼각형의 완성조건 (2) (java)

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

    [프로그래머스, 181835] 조건에 맞게 수열 변환하기 3 (java)

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

    [프로그래머스, 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