Problem Solving/Programmers

    [프로그래머스, 120896] 한 번만 등장한 문자 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/120896 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 76.9 MB, 시간: 0.08 ms사용 알고리즘: 구현class Solution { public String solution(String s) { // 등장 횟수를 저장하기 위한 배열 int[] count = new int['z' - 'a' + 1]; for(int i = 0; i

    [프로그래머스, 43238] 입국심사 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/43238 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 82.5 MB, 시간: 45.28 ms사용 알고리즘: 이분탐색class Solution { public long solution(int n, int[] times) { long answer = Long.MAX_VALUE; // 이분탐색 long s = 0, e = Long.MAX_VALUE, m; long count; while(s = n) ..

    [프로그래머스, 42746] 가장 큰 수 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/42746 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 145 MB, 시간: 212.04 ms사용 알고리즘: 정렬import java.util.*;class Solution { public String solution(int[] numbers) { // 정렬을 위한 리스트 List list = new ArrayList(); boolean flag = true; // 배열에 0만 있는지 채크 for(int i = 0; i ..

    [프로그래머스, 181878] 원하는 문자열 찾기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/181878 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 78.2 MB, 시간: 8.07 ms사용 알고리즘: 문자열class Solution { public int solution(String myString, String pat) { // 두 문자열의 모든 영문자를 소문자로 변경 myString = myString.toLowerCase(); pat = pat.toLowerCase(); if(myString...

    [프로그래머스, 181879] 길이에 따른 연산 (java)

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

    [프로그래머스, 181880] 1로 만들기 (java)

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

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

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

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

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

    [프로그래머스, 120894] 영어가 싫어요 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/120894 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 80.7 MB, 시간: 0.10 ms사용 알고리즘: 문자열class Solution { public long solution(String numbers) { String[] stringNumbers = new String[] {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}; long..

    [프로그래머스, 49994] 방문 길이 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/49994 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 69.7 MB, 시간: 0.10 ms사용 알고리즘: 구현, 시뮬레이션class Solution { public int solution(String dirs) { // (-5, 5) 지점을 (0, 0)으로 // (0, 0) 지점을 (5, 5)로 변경 // (i, j, 0)가 true라면 (i, j)의 윗 길이 이미 걸어본 길을 뜻함 (상하우좌) boolean[][][] ..