전체 글
[프로그래머스, 12948] 핸드폰 번호 가리기 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/12948 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 82.2 MB, 시간: 2.45 ms사용 알고리즘: 구현class Solution { public String solution(String phone_number) { int length = phone_number.length(); String answer = "*".repeat(length - 4) + phone_number.substring(length -..
[프로그래머스, 12901] 2016년 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/12901 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 85.4 MB, 시간: 0.03 ms사용 알고리즘: 구현class Solution { public String solution(int a, int b) { // 각 월의 일수 int[] count = new int[] {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; // 요일(1월 1일이 금요일이므로 금요일부터 저장) ..
[프로그래머스, 42883] 큰 수 만들기 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/42883 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 93.1 MB, 시간: 4951.01 ms사용 알고리즘: 탐욕법class Solution { public String solution(String number, int k) { StringBuilder answer = new StringBuilder(); // 현재 지울 수 있는 개수 int count = k; int now = 0, nex..
[프로그래머스, 42860] 조이스틱 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/42860# 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 78.3 MB, 시간: 0.06 ms사용 알고리즘: 탐욕법class Solution { public int solution(String name) { int answer = 0; int dist = name.length() - 1; // dist의 최대길이는 오른쪽 커서만으로 모든 문자를 이동하는 것 int next; for(int i = 0; i
[프로그래머스, 181837] 커피 심부름 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/181837 코딩테스트 연습 - 커피 심부름알고리즘 문제 연습 카카오톡 친구해요! 프로그래머스 교육 카카오 채널을 만들었어요. 여기를 눌러, 친구 추가를 해주세요. 신규 교육 과정 소식은 물론 다양한 이벤트 소식을 가장 먼저 알려school.programmers.co.kr메모리: 81 MB, 시간: 0.24 ms사용 알고리즘: 자료구조import java.util.*;class Solution { public int solution(String[] order) { HashSet americano = new HashSet(); americano.addAll(L..
[프로그래머스, 181834] l로 만들기 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/181834 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 78.9 MB, 시간: 11.32 ms사용 알고리즘: 문자열class Solution { public String solution(String myString) { StringBuilder answer = new StringBuilder(); for(int i = 0; i
[프로그래머스, 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..