➜ 코딩 테스트/프로그래머스

프로그래머스 - 대문자로 바꾸기

class Solution { public String solution(String myString) { String answer = ""; answer = myString.toUpperCase(); return answer; } }

➜ 코딩 테스트/프로그래머스

프로그래머스 - 정수 부분

class Solution { public int solution(double flo) { int answer = 0; answer = (int) flo; return answer; } }

➜ 코딩 테스트/프로그래머스

프로그래머스 - 배열 만들기 4

스택으로도 구현이 가능하지만 LinkedList를 공부할겸 써 봤다 아직은 어려운걸보니 초보인게 맞다 import java.util.*; class Solution { public int[] solution(int[] arr) { LinkedList stk = new LinkedList(); for(int i = 0; i i).toArray(); } }

➜ 코딩 테스트/프로그래머스

프로그래머스 - 콜라츠 수열 만들기

import java.util.*; class Solution { public static List solution(int n) { List answer = new ArrayList(); answer.add(n); while(n != 1){ if(n % 2 == 0){ n = n/2; }else{ n = 3*n + 1; } answer.add(n); } System.out.println(answer); return answer; } }

➜ 코딩 테스트/프로그래머스

프로그래머스 - 카운트 업

class Solution { public int[] solution(int start, int end) { int[] str = new int[end-start + 1]; for(int i = 0; i

➜ 코딩 테스트/프로그래머스

프로그래머스 - 배열 만들기 2

import java.util.*; class Solution { public int[] solution(int l, int r) { List answer = new ArrayList(); for(int i = l; i

➜ 코딩 테스트/프로그래머스

프로그래머스 - 수열과 구간 쿼리 4

class Solution { public int[] solution(int[] arr, int[][] queries) { for (int[] query : queries) { int start = query[0]; int end = query[1]; int k = query[2]; for (int i = start; i

➜ 코딩 테스트/프로그래머스

프로그래머스 - 수열과 구간 쿼리 2

class Solution { public int[] solution(int[] arr, int[][] queries) { int[] answer = new int[queries.length]; for (int i = 0; i k) { min = Math.min(min, arr[j]); check = true; } } if(check){ answer[i] = min;..

➜ 코딩 테스트/프로그래머스

프로그래머스 - 수열과 구간 쿼리 3

class Solution { public int[] solution(int[] arr, int[][] queries) { for(int i = 0; i < queries.length; i++){ int[] query = queries[i]; int a = query[0]; int b = query[1]; int temp = arr[a]; arr[a] = arr[b]; arr[b] = temp; } return arr; } }

➜ 코딩 테스트/프로그래머스

프로그래머스 - 수 조작하기1

class Solution { public int solution(int n, String control) { int answer = 0; String[] controlarr = new String[control.length()]; for(int i = 0; i < control.length(); i++){ controlarr[i] = String.valueOf(control.charAt(i)); } for(int j = 0; j < control.length(); j++){ if(controlarr[j].equals("w")){ n += 1; }else if(controlarr[j].equals("s")){ n -= 1; }else if(controlarr[j].equals("d")){ n += 10;..

강맹석
'➜ 코딩 테스트/프로그래머스' 카테고리의 글 목록 (30 Page)