본문 바로가기

전체 글

(212)
수박수박수박수박수박수? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 class Solution { public String solution(int n) { String answer = ""; StringBuilder sb = new StringBuilder(); for (int i = 0; i
시저 암호 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 class Solution { public String solution(String s, int n) { String answer = ""; StringBuilder str = new StringBuilder(); for (int i = 0; i = 'a' && s.charAt(i) 'z') str.append((char) ('a' + s.charAt(i) + n - 'z' - 1)); else str.append((char) (s.charAt(i) + n)); } else if (s.charAt(i) >= 'A' && s.charAt(i) 'Z') str.append((char) ('A' +..
문자열 내 마음대로 정렬하기 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map.Entry; class Solution { public String[] solution(String[] strings, int n) { String[] answer = new String[str..
두 정수 사이의 합 1 2 3 4 5 6 7 8 9 10 11 12 class Solution { public long solution(int a, int b) { long answer = 0; if(a
음양 더하기 1 2 3 4 5 6 7 8 class Solution { public int solution(int[] absolutes, boolean[] signs) { int answer = 0; for (int i = 0; i
내적 1 2 3 4 5 6 7 8 class Solution { public int solution(int[] a, int[] b) { int answer = 0; for (int i = 0; i
서울에서 김서방 찾기 1 2 3 4 5 6 7 8 9 10 class Solution { public String solution(String[] seoul) { for (int i = 0; i
가운데 글자 가져오기 1 2 3 4 5 6 7 8 9 10 11 class Solution { public String solution(String s) { String answer = ""; int len = s.length(), mid = len / 2; if (len % 2 == 0) answer = s.substring(mid - 1, mid + 1); else answer = s.substring(mid, mid + 1); return answer; } } Colored by Color Scripter cs