목록코딩테스트/프로그래머스 (279)
Make Be BackEnd

class Solution { public int solution(int[] sides) { int answer = 0; int max = Integer.MIN_VALUE; int min = Integer.MAX_VALUE; for(int i=0; i max) { max = sides[i]; } } int start = max-min; for(int i = start + 1; i class Solution { public int solution(int[] sides) { int answer = 0; int max = Math.max..

class Solution { public int solution(String my_string) { int answer = 0; int value = 0; for(int i=0; i 0) { answer += value; } value=0; } } if(Character.isDigit(my_string.charAt(my_string.length()-1))) { answer += value; } return answer; }} class Solution { public int solution(String my_string) { int answer = 0; St..

class Solution { public String solution(String polynomial) { String answer = ""; String[] list = polynomial.split("\\+"); int sumX = 0, sum = 0; for(String s : list){ if(s.indexOf("x") >= 0) { int value = s.replaceAll("x", "").trim().isEmpty() ? 1 : Integer.valueOf(s.replaceAll("x", "").trim()); sumX += value; ..

import java.util.*;class Solution { public int[] solution(String[] keyinput, int[] board) { int[] answer = {0,0}; Map list = new HashMap(); list.put("left",new int[]{-1,0}); list.put("right",new int[]{1,0}); list.put("up",new int[]{0,1}); list.put("down",new int[]{0,-1}); int maxX = board[0]/2; int maxY = board[1]/2; for(S..

class Solution { public int solution(int[][] dots) { int xmax = Integer.MIN_VALUE,xmin = Integer.MAX_VALUE; int ymax = Integer.MIN_VALUE,ymin = Integer.MAX_VALUE; for(int[] value : dots){ if(value[0] > xmax){ xmax = value[0]; } if(value[0] ymax){ ymax = value[1]; } if(value[1] class ..

class Solution { public String[] solution(String my_str, int n) { int len = my_str.length()%n==0 ? my_str.length()/n : my_str.length()/n + 1; String[] answer = new String[len]; int idx = 0; for(int i=0; i class Solution { public String[] solution(String my_str, int n) { int resultCnt = (my_str.length() + n - 1) / n; String[] answer = new String[..