[프로그래머스/Java] Lv.0 배열의 원소만큼 추가하기 문제 풀이 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 import java.util.ArrayList; import java.util.Arrays; import java.util.List; class Solution { public int[] solution(int[] arr) { int totalLength = Arrays.stream(arr).sum(); int[] result = new int[totalLength]; int index = 0; for (int num : arr) { for (int i = 0; i [JAVA] 프로그래머스 스쿨/Java Lv.0 2024. 1. 27. 21:07
[프로그래머스/Java] Lv.0 rny_string 문제 풀이 1 2 3 4 5 class Solution { public String solution(String rny_string) { return rny_string.replace("m", "rn"); } } Colored by Color Scripter cs [JAVA] 프로그래머스 스쿨/Java Lv.0 2024. 1. 27. 21:05
[프로그래머스/Java] Lv.0 공백으로 구분하기 2 문제 풀이 1 2 3 4 5 class Solution { public String[] solution(String my_string) { return my_string.trim().split("\\s+"); } } Colored by Color Scripter cs [JAVA] 프로그래머스 스쿨/Java Lv.0 2024. 1. 27. 21:03
[프로그래머스/Java] Lv.0 공백으로 구분하기 1 문제 풀이 1 2 3 4 5 6 class Solution { public String[] solution(String my_string) { return my_string.split(" "); } } Colored by Color Scripter cs [JAVA] 프로그래머스 스쿨/Java Lv.0 2024. 1. 27. 21:01
[프로그래머스/Java] Lv.0 특정한 문자를 대문자로 바꾸기 문제 풀이 1 2 3 4 5 class Solution { public String solution(String my_string, String alp) { return my_string.replace(alp, alp.toUpperCase()); } } Colored by Color Scripter cs [JAVA] 프로그래머스 스쿨/Java Lv.0 2024. 1. 24. 22:07
[프로그래머스/Java] Lv.0 A 강조하기 문제 풀이 1 2 3 4 5 class Solution { public String solution(String myString) { return myString.toLowerCase().replace("a", "A"); } } Colored by Color Scripter cs [JAVA] 프로그래머스 스쿨/Java Lv.0 2024. 1. 24. 22:05
[프로그래머스/Java] Lv.0 배열에서 문자열 대소문자 변환하기 문제 풀이 1 2 3 4 5 6 7 8 9 10 11 12 13 14 class Solution { public String[] solution(String[] strArr) { String[] answer = new String[strArr.length]; for (int i = 0; i [JAVA] 프로그래머스 스쿨/Java Lv.0 2024. 1. 23. 22:35
[프로그래머스/Java] Lv.0 소문자로 바꾸기 문제 풀이 1 2 3 4 5 class Solution { public String solution(String myString) { return myString.toLowerCase(); } } Colored by Color Scripter cs [JAVA] 프로그래머스 스쿨/Java Lv.0 2024. 1. 23. 22:33