Problem Solving/Programmers

    [프로그래머스, 181833] 특별한 이차원 배열 1 (java)

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

    [프로그래머스, 77884] 약수의 개수와 덧셈 (java)

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

    [프로그래머스, 181840] 정수 찾기 (java)

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

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

    https://school.programmers.co.kr/learn/courses/30/lessons/181839 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 79.6 MB, 시간: 0.06 ms사용 알고리즘: 구현class Solution { public int solution(int a, int b) { if(a % 2 == 1 && b % 2 == 1) return (int)Math.pow(a, 2) + (int)Math.pow(b, 2); else if(a % 2 == 0 && b % 2 == 0) return Ma..

    [프로그래머스, 181838] 날짜 비교하기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181838 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 82.9 MB, 시간: 0.02 ms사용 알고리즘: 구현class Solution { public int solution(int[] date1, int[] date2) { // 년 확인 if(date1[0] date2[0]) return 0; else { // 월 확인 if(date1[1] date2[1]) ..

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