diff --git a/.gitignore b/.gitignore index 4928814..9a8ac41 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ CLAUDE.md .claude/ -.omc \ No newline at end of file +.omc +.project + +# Track only Java sources under LeeBJ +/LeeBJ/** +!/LeeBJ/src/ +!/LeeBJ/src/**/*.java \ No newline at end of file diff --git a/LeeBJ/src/JadenCaseString.java b/LeeBJ/src/JadenCaseString.java new file mode 100644 index 0000000..43c8650 --- /dev/null +++ b/LeeBJ/src/JadenCaseString.java @@ -0,0 +1,36 @@ +/* + * 프로그래머스 코딩테스트 문제 Lv.2 정답률 높은 순 기준 + * 문제명 : JadenCase 문자열 만들기 + * 날짜 : 2026 - 04 - 06 + * 풀이 시간 : 23분 + */ +public class JadenCaseString { + public static void main(String[] args) { + String testCase = "3people unFollowed me"; + + String answer = solution(testCase); + System.out.println(answer); + } + + static String solution(String s) { + char[] arr = s.toCharArray(); + + boolean isStart = true; + + for (int i = 0; i < arr.length; i++) { + if (arr[i] == ' ') { + isStart = true; + } else { + if (isStart) { + arr[i] = Character.toUpperCase(arr[i]); + isStart = false; + } else { + arr[i] = Character.toLowerCase(arr[i]); + } + } + } + + String answer = new String(arr); + return answer; + } +} diff --git a/LeeBJ/src/MaxValAndMinVal.java b/LeeBJ/src/MaxValAndMinVal.java new file mode 100644 index 0000000..f9f95e1 --- /dev/null +++ b/LeeBJ/src/MaxValAndMinVal.java @@ -0,0 +1,29 @@ +/* + * 프로그래머스 코딩테스트 문제 Lv.2 정답률 높은 순 기준 + * 문제명 : 최댓값과 최솟값 + * 날짜 : 2026 - 04 - 06 + * 풀이 시간 : 8분 + */ + +import java.util.Arrays; + +public class MaxValAndMinVal { + public static void main(String[] args) { + String testCase = "-2 -1 0 1 2"; + + String answer = solution(testCase); + System.out.println(answer); + } + + static String solution(String s) { + int[] nums = Arrays.stream(s.split(" ")) + .mapToInt(Integer::parseInt) + .toArray(); + + int maxVal = Arrays.stream(nums).max().getAsInt(); + int minVal = Arrays.stream(nums).min().getAsInt(); + + String answer = minVal + " " + maxVal; + return answer; + } +} diff --git a/LeeBJ/src/ValidParentheses.java b/LeeBJ/src/ValidParentheses.java new file mode 100644 index 0000000..097f5ef --- /dev/null +++ b/LeeBJ/src/ValidParentheses.java @@ -0,0 +1,33 @@ +/* + * 프로그래머스 코딩테스트 문제 Lv.2 정답률 높은 순 기준 + * 문제명 : 올바른 괄호 + * 날짜 : 2026 - 04 - 07 + * 풀이 시간 : 53분 + */ +public class ValidParentheses { + public static void main(String[] args) { + String testCase = "(()("; + + boolean answer = solution(testCase); + System.out.println(answer); + } + + static boolean solution(String s) { + char[] charArr = s.toCharArray(); + + int count = 0; + for (char c : charArr) { + if (c == '(') { + count++; + } else { + count--; + } + + // count가 음수면 바로 false 리턴 + if (count < 0) return false; + } + + boolean answer = (count == 0); + return answer; + } +} diff --git a/README.md b/README.md index 2829acf..4ffe05a 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,7 @@ | 이지현 | https://github.com/sik9252 | TS/JS | | 최준호 | https://github.com/raejun92 | TS/JS | | 추슬기 | https://github.com/doitchuu | TS/JS | +| 이배진 | https://github.com/LeeBaeJin | Java | > 멤버 추가 시: PR로 이 표에 본인 정보 추가해주세요.