Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #3

Open
wants to merge 85 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
a17dbb2
test commit
yangyanghyunjung Oct 12, 2023
78c1188
과연 성공??
yangyanghyunjung Oct 12, 2023
524555b
커밋커밋
Oct 13, 2023
e3d672d
yangyanghunjung branch test
Oct 17, 2023
672b92c
yangyanghunjung branch test2
Oct 17, 2023
4ef0008
커밋커밋
Oct 13, 2023
8d804b2
과연 성공??
yangyanghyunjung Oct 12, 2023
0d8e1b8
과연 성공??
yangyanghyunjung Oct 12, 2023
ffd5ecb
yangyanghunjung branch test
Oct 17, 2023
02b926e
yangyanghunjung branch test2
Oct 17, 2023
b6220c5
커밋커밋
Oct 13, 2023
3478907
과연 성공??
yangyanghyunjung Oct 12, 2023
b14bde1
커밋커밋
Oct 13, 2023
8a647ce
Revert "커밋커밋"
Oct 13, 2023
21627d6
com 커밋 테스트
Oct 13, 2023
f0a51ca
onbarding_problem1 완성
Oct 13, 2023
21fb8f0
기능목록 작성
Oct 16, 2023
d035f7a
StringValidation 기능 commit
Oct 16, 2023
68b0610
FindAndRemoveDuplicate 기능 구현
Oct 16, 2023
d6e8ad2
FindAndRemoveDuplicate 중복값 삭제 기능
Oct 16, 2023
43f2cca
코드리뷰 2jun0's 중복값 제거 기능
Oct 16, 2023
2c3465e
Test code 추가
Oct 16, 2023
eb39b73
Problem2 Main함수
Oct 16, 2023
7e17955
충돌
Oct 16, 2023
4e2a942
FindAndRemoveDuplicate 충돌 해결
Oct 16, 2023
8f86a76
FindAndRemoveDuplicate 충돌 해결2
Oct 16, 2023
977291e
Test코드 충돌 해결2
Oct 16, 2023
fb60323
커밋커밋;;
Oct 13, 2023
28eade5
Revert "커밋커밋"
Oct 13, 2023
f896369
com 커밋 테스트
Oct 13, 2023
0fd7ded
Test code 추가
Oct 16, 2023
2bb13a8
충돌
Oct 16, 2023
6afafa4
FindAndRemoveDuplicate 충돌 해결
Oct 16, 2023
affbd19
FindAndRemoveDuplicate 충돌 해결2
Oct 16, 2023
09f419b
Test코드 충돌 해결2
Oct 16, 2023
57523cc
Merge branch 'yangyanghyunjung'
Oct 17, 2023
ed7da2a
main merge
Oct 17, 2023
35de17b
main merge
Oct 17, 2023
ff00a71
yangyanghyunjung에 기능3 목록 커밋
Oct 17, 2023
97f76ca
yangyanghyunjung에 기능3 목록 커밋2
Oct 17, 2023
7e7ad31
yangyanghyunjung에 기능3 목록 커밋3
Oct 17, 2023
323327a
problem3 기능목록 커밋
Oct 17, 2023
9e94115
problem3_ NumberValidation 기능 커밋
Oct 17, 2023
4a925c5
problem3_ ClapCount 기능 커밋
Oct 17, 2023
9e332cd
problem3_ Main함수 커밋
Oct 17, 2023
e0508aa
problem3_ TestCode 추가
Oct 17, 2023
a5bc7fe
problem3_ jiyeong's 코드리뷰
Oct 17, 2023
312ed9e
problem4 기능목록 커밋
yangyanghyunjung Oct 17, 2023
3007fd6
problem4_WordValidation 커밋
yangyanghyunjung Oct 17, 2023
feabc5f
problem4_ConvertWord 커밋
yangyanghyunjung Oct 17, 2023
a16eece
problem4_Main함수 커밋
yangyanghyunjung Oct 17, 2023
130fc53
problem4_Test Code 추가 커밋
yangyanghyunjung Oct 17, 2023
6429435
problem4_functionList.md 수정 (대문자 > 대문자로 수정)
yangyanghyunjung Oct 17, 2023
c45f7d0
yangyanghyunjung에 기능3 목록 커밋
Oct 17, 2023
df44936
yangyanghyunjung에 기능3 목록 커밋2
Oct 17, 2023
fbdcf89
yangyanghyunjung에 기능3 목록 커밋3
Oct 17, 2023
80c51e9
problem3 기능목록 커밋
Oct 17, 2023
f9628e5
problem3_ NumberValidation 기능 커밋
Oct 17, 2023
86ff47b
problem3_ ClapCount 기능 커밋
Oct 17, 2023
7b5bb9b
problem3_ Main함수 커밋
Oct 17, 2023
c755f13
problem3_ TestCode 추가
Oct 17, 2023
10c982c
problem3_ jiyeong's 코드리뷰
Oct 17, 2023
77b9660
problem4 기능목록 커밋
yangyanghyunjung Oct 17, 2023
635fffc
problem4_WordValidation 커밋
yangyanghyunjung Oct 17, 2023
196778e
problem4_ConvertWord 커밋
yangyanghyunjung Oct 17, 2023
1fa2768
problem4_Main함수 커밋
yangyanghyunjung Oct 17, 2023
7ed6048
problem4_Test Code 추가 커밋
yangyanghyunjung Oct 17, 2023
cf4fad2
problem4_functionList.md 수정 (대문자 > 대문자로 수정)
yangyanghyunjung Oct 17, 2023
c371219
잔디test용
yangyanghyunjung Oct 17, 2023
d9c4ade
problem4_com용 README commit
Oct 17, 2023
43e6b89
Merge remote-tracking branch 'origin/yangyanghyunjung' into yangyangh…
Oct 17, 2023
c1fe1e7
problem4_2jun0 코드리뷰
Oct 18, 2023
6e5b827
problem6_기능목록
Oct 18, 2023
108c249
problem6_ FindDuplicateNickname 기능
Oct 18, 2023
50aa7b4
problem6_ SortEmail 기능
Oct 18, 2023
71e10e5
problem6_ ValidationCheck
Oct 18, 2023
94884ad
problem6_ Main함수
Oct 18, 2023
9d2882f
problem6_ Test
Oct 18, 2023
8962f24
problem4_2jun0 코드리뷰
Oct 18, 2023
7566fb0
problem6_기능목록
Oct 18, 2023
6c16c1a
problem6_ FindDuplicateNickname 기능
Oct 18, 2023
f3174f9
problem6_ SortEmail 기능
Oct 18, 2023
fd26993
problem6_ ValidationCheck
Oct 18, 2023
38cf945
problem6_ Main함수
Oct 18, 2023
b54d18a
Merge remote-tracking branch 'origin/yangyanghyunjung' into yangyangh…
yangyanghyunjung Oct 18, 2023
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
4 changes: 4 additions & 0 deletions Test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Git 연결 확인 test
---
:raised_hand:
- 안녕
20 changes: 20 additions & 0 deletions src/main/java/Problem2/FindAndRemoveDuplicate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package Problem2;
import java.util.ArrayList;
import java.util.Arrays;

public class FindAndRemoveDuplicate {
public String FindAndRemve (String cryptogram)
{
String[] cryptogramArray = cryptogram.split("");
ArrayList<String> cryptogramList = new ArrayList<String>(Arrays.asList(cryptogramArray));
for (int i = 0; i <cryptogramList.size() - 1; i++) {
if (cryptogramList.get(i).equals(cryptogramList.get(i + 1))) {
cryptogramList.remove(i);
cryptogramList.remove(i);
i -= 2;
}
}
String str = String.join("",cryptogramList);
return str;
}
}
18 changes: 18 additions & 0 deletions src/main/java/Problem2/StringValidation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package Problem2;

public class StringValidation {
public boolean Validate (String cryptogram) {
// 문자열 길이 오류
if (cryptogram.length() < 1 || cryptogram.length() > 1000) {
return false;
}
// 대문자 포함될 경우
char[] charArray = cryptogram.toCharArray();
for (int i = 0; i < charArray.length; i++) {
if (Character.isUpperCase(charArray[i])) {
return false;
}
}
return true;
}
}
35 changes: 35 additions & 0 deletions src/main/java/Problem2/eJun0SSockSSock.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package Problem2;

import java.util.Stack;

public class eJun0SSockSSock {
// 2jun0's Code
// 1. Stack 생성
// 2. for문 순회
// 3. push || pop

public String ConvertStackToString(Stack<Character> stack) {
StringBuilder sb = new StringBuilder();
// 후입선출 고려 0번째 index에 add가 아닌 insert 해줌.
while (!stack.isEmpty()) { //모두 pop() 되면 종료
// pop()은 제거하면서 sb에 insert도 가능한가봄
sb.insert(0,stack.pop());
}
return sb.toString();
}
public String RemoveDuplicate(String cryptogram) {
Stack<Character> stack = new Stack<Character>();

for (char c: cryptogram.toCharArray()) {
// 나는 문자열 비교시 equals ( 참조형 비교 위해) 썼는데 char은 기본형이라 == 시용 가능
if (stack.size() > 0 && stack.peek().equals(c)) {
stack.pop();
} else {
stack.push(c);
}
}
return ConvertStackToString(stack);
}


}
16 changes: 16 additions & 0 deletions src/main/java/Problem2/functionList.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 🚀 problem2 기능 목록
- - -
### 1. StringValidation
```java
System.out.println("예외");
```
- 글자수가 **1**이하 **1000** 이상일 경우
- **대문자**가 들어올 경우
- 빈문자열 값: ```return 빈문자열```
- - -
### 2. FindAndRemoveDuplicate
- **LinkedList**로 첫 문자부터 순회
- 반복문자 나올 시 next node **포인터 변경** (삭제)
- 반복이 없다면 다음 node로 이동
- ```return 최종 문자열```

12 changes: 12 additions & 0 deletions src/main/java/hi/Compare.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package hi;

public class Compare {
public int CompareScore(Integer largePobiScore ,Integer largeCrongScore) {
if (largePobiScore < largeCrongScore) {
return 2;
} else if (largePobiScore > largeCrongScore) {
return 1;
}
return 0;
}
}
28 changes: 28 additions & 0 deletions src/main/java/hi/Page.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package hi;

import java.util.List;
import hi.Score;

public class Page {
private static final int MIN = 3;
private static final int MAX =398;

public int PageValidation (List<Integer> pobi, List<Integer> crong) {
int pobiLeft = pobi.get(0);
int pobiRight = pobi.get(1);
int crongLeft = crong.get(0);
int crongRight = crong.get(1);

if (pobiRight - pobiLeft != 1 || crongRight - crongLeft != 1) {
return -1;
}
if (pobiLeft < MIN || pobiLeft > MAX || crongLeft < MIN || crongLeft > MAX
|| pobiRight < MIN || pobiRight > MAX || crongRight < MIN || crongRight > MAX) {
return -1;
}
Score score = new Score();
int win = score.LargeScore(pobiLeft, pobiRight, crongLeft, crongRight);

return win;
}
}
40 changes: 40 additions & 0 deletions src/main/java/hi/Score.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package hi;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class Score {
public Integer LargeScore(Integer pobiLeft, Integer pobiRight, Integer crongLeft, Integer crongRight) {

int largePobiScoreLeft = Calculate(pobiLeft);
int largePobiScoreRight = Calculate(pobiRight);
int largeCrongScoreLeft = Calculate(crongLeft);
int largeCrongScoreRight = Calculate(crongRight);

int largePobiScore = largePobiScoreLeft < largePobiScoreRight ? largePobiScoreRight : largePobiScoreLeft;
int largeCrongScore = largeCrongScoreLeft < largeCrongScoreRight ? largeCrongScoreRight : largeCrongScoreLeft;

Compare compare = new Compare();
int win = compare.CompareScore(largePobiScore, largeCrongScore);

return win;
}
public int Calculate (int score) {
LinkedList<Integer> scoreLists = new LinkedList<>();
while (score > 0) {
scoreLists.push(score % 10);
score /= 10;
}
int add = 0;
int mul = 1;
for (int i = 0; i < scoreLists.size(); i++) {
add += scoreLists.get(i);
mul *= scoreLists.get(i);
}

return add < mul ? mul : add;
}
}


7 changes: 5 additions & 2 deletions src/main/java/onboarding/Problem1.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package onboarding;

import java.util.List;
import hi.Page;

class Problem1 {
public static int solution(List<Integer> pobi, List<Integer> crong) {
int answer = Integer.MAX_VALUE;
return answer;
Page page = new Page();
int score = page.PageValidation(pobi, crong);
System.out.println(score);
return score;
}
}
17 changes: 15 additions & 2 deletions src/main/java/onboarding/Problem2.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
package onboarding;
import Problem2.StringValidation;
import Problem2.FindAndRemoveDuplicate;
import Problem2.eJun0SSockSSock;

public class Problem2 {
public static String solution(String cryptogram) {
String answer = "answer";
return answer;
// 문자열 validation check return boolean
StringValidation stringValidation = new StringValidation();
if (!stringValidation.Validate(cryptogram)) {
return "";
}
// validation check 값이 true면 중복 삭제
// FindAndRemoveDuplicate FRD = new FindAndRemoveDuplicate();
// String result = FRD.FindAndRemve(cryptogram);
//2jun0's
eJun0SSockSSock ejun0 = new eJun0SSockSSock();
String result = ejun0.RemoveDuplicate(cryptogram);
return result;
}
}
5 changes: 3 additions & 2 deletions src/main/java/onboarding/Problem3.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package onboarding;
import problem3.NumberValidation;

public class Problem3 {
public static int solution(int number) {
int answer = 0;
return answer;
NumberValidation numberValidation = new NumberValidation();
return numberValidation.validateNumber(number);
}
}
8 changes: 8 additions & 0 deletions src/main/java/onboarding/Problem4.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
package onboarding;
import problem4.WordValidation;
import problem4.ConvertWord;

public class Problem4 {
public static String solution(String word) {
WordValidation wordValidation = new WordValidation();
if (wordValidation.ValidateWordLength(word)) {
ConvertWord convertWord = new ConvertWord();
return convertWord.IsAlphabet(word);
}

String answer = "";
return answer;
}
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/onboarding/Problem6.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
package onboarding;

import java.util.List;
import problem6.FindDuplicateNickname;
import problem6.ValidationCheck;

public class Problem6 {
public static List<String> solution(List<List<String>> forms) {
ValidationCheck validationCheck = new ValidationCheck();
FindDuplicateNickname findDuplicateNickname = new FindDuplicateNickname();

boolean validateMemberCount = validationCheck.MemberCountValidate(forms);
if (validateMemberCount) {
List<String> reslut = findDuplicateNickname.FindDuplicateNickname(forms);
return reslut;
}
List<String> answer = List.of("answer");
return answer;
}
Expand Down
28 changes: 28 additions & 0 deletions src/main/java/problem3/ClapCount.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package problem3;

public class ClapCount {
public int CountCalp(int number) {
int count = 0;
// for (int i = 1; i <= number; ++i) {
// String stringNumber = Integer.toString(i);
// // 2번 이상일 경우
// for (int j = 0; j < stringNumber.length(); ++j){
// if (stringNumber.charAt(j) == '3' || stringNumber.charAt(j) == '6' || stringNumber.charAt(j) == '9') {
// count++;
// }
// }
// }
//jiyeong's Code + (-48)
for (int i = 1; i < number + 1; ++i) {
String strNum = Integer.toString(i);
for (int j = 0; j < strNum.length(); ++j) {
int convertIntNum = strNum.charAt(j) - 48;
if (convertIntNum % 3 == 0 && convertIntNum != 0) {
count++;
}
}
}

return count;
}
}
12 changes: 12 additions & 0 deletions src/main/java/problem3/NumberValidation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package problem3;

public class NumberValidation {
public int validateNumber (int number) {
if (number < 1 || number > 1000) {
System.out.println("1 이상 1000 이하의 숫자만 가능합니다.");
return -1;
}
ClapCount clapCount = new ClapCount();
return clapCount.CountCalp(number);
}
}
9 changes: 9 additions & 0 deletions src/main/java/problem3/functionList3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 🚀 problem3 기능목록
- - -
**1. NumberValidation**
> - number이 1 이하 1000 이상일 경우 exception

**2. ClapCount**
> - number에 3, 6, 9 가 포함 되면 : count++;
> - return count;
> - 3,6,9 가 n 번 포함 되어 있을 경우는 n번 counting
52 changes: 52 additions & 0 deletions src/main/java/problem4/ConvertWord.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package problem4;

public class ConvertWord {
// public String ConvertWord(String word) {
// char[] wordCharArray = word.toCharArray(); // 미리 선언 vs for문에서 한 번에 처리
// StringBuilder builder = new StringBuilder(1024);
// // 이 부분 리팩토링 필요 !! 23/10/18
// for (char c: wordCharArray) {
// if (c > 64 && c < 91) {
// // 대문자 > 대문자
// int T = 90 - (c - 65);
// builder.append((char)T);
// } else if (c > 96 && c < 123) {
// // 소문자 > 소문자
// int t = 122 - (c - 97);
// builder.append((char)t);
// } else if (c == 32) {
// // 스페이스
// builder.append(c);
// }
// }
// return builder.toString();
// }
public char ConvertAlphabet(char c) {
char startIdx = ' ';
char lastIdx = ' ';

// 대소문자 구분
if (Character.isUpperCase(c)) {
startIdx = 'A'; // 대문자
lastIdx = 'Z';
} else {
startIdx = 'a'; // 소문자
lastIdx = 'z';
}
return (char)(lastIdx - (c - startIdx));
}
public String IsAlphabet (String word) {
StringBuilder builder = new StringBuilder(1024);
// 2jun0 + me
for (char c: word.toCharArray()) { // 선언하지 않고 for문에서 한 번에 처리
if (Character.isAlphabetic(c)) {
// 알파벳일 경우 convert
builder.append(ConvertAlphabet(c));
} else {
// !, ' ', ~ 등등은 그대로 append
builder.append(c);
}
}
return builder.toString();
}
}
Loading