Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
CLAUDE.md
.claude/
.omc
.omc
.project

# Track only Java sources under LeeBJ
/LeeBJ/**
!/LeeBJ/src/
!/LeeBJ/src/**/*.java
36 changes: 36 additions & 0 deletions LeeBJ/src/JadenCaseString.java
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

직관적이라 이해하기 편하네요

Original file line number Diff line number Diff line change
@@ -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;
}
}
29 changes: 29 additions & 0 deletions LeeBJ/src/MaxValAndMinVal.java
Original file line number Diff line number Diff line change
@@ -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(" "))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

지현님이 말씀하신 것처럼 자바에서는 작은 따음표랑 큰 따음표를 다르게 인식하는 것 같네요!
해당 답을 작은 따음표로 바꿔서 제출하면 String으로 바꿀 수 없다는 애러가 떠요

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 추가적으로 설명을 드리자면 아까 문자열 타입(String, char)에 대해서

큰따옴표 ("): String str = "Hello"; 와 같이 0개 이상의 문자를 포함하는 문자열에 사용.
작은따옴표 ('): char ch = 'A'; 와 같이 반드시 단 하나의 문자만 담을 때 사용.

차이점 또한 존재합니다! 이 부분 아까 PT할 때 설명누락된 점. 죄송합니다

.mapToInt(Integer::parseInt)
.toArray();

int maxVal = Arrays.stream(nums).max().getAsInt();
int minVal = Arrays.stream(nums).min().getAsInt();

String answer = minVal + " " + maxVal;
return answer;
}
}
33 changes: 33 additions & 0 deletions LeeBJ/src/ValidParentheses.java
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저는 예전에 풀었던 기억이 남아있어서 해당 아이디어를 떠올릴 수 있었는데 배진님은 아이디어를 생각해 내시다니 대단해요!

Original file line number Diff line number Diff line change
@@ -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;
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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로 이 표에 본인 정보 추가해주세요.

Expand Down
Loading