From 154d190b410273c3ecd84dd42b52e0113dd77ba1 Mon Sep 17 00:00:00 2001 From: haemin4738 <132271194+haemin4738@users.noreply.github.com> Date: Tue, 8 Jul 2025 09:48:03 +0900 Subject: [PATCH 1/8] =?UTF-8?q?feat:=202=EC=A3=BC=EC=B0=A8=20-=20PG=5F8130?= =?UTF-8?q?1=EC=88=AB=EC=9E=90=20=EB=AC=B8=EC=9E=90=EC=97=B4=EA=B3=BC=20?= =?UTF-8?q?=EC=98=81=EB=8B=A8=EC=96=B4=20=EB=AC=B8=EC=A0=9C=20=ED=92=80?= =?UTF-8?q?=EC=9D=B4=20[=EC=9D=B4=ED=95=B4=EB=AF=BC]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/week02/haemin/PG_81301.java | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/week02/haemin/PG_81301.java diff --git a/src/week02/haemin/PG_81301.java b/src/week02/haemin/PG_81301.java new file mode 100644 index 0000000..d716606 --- /dev/null +++ b/src/week02/haemin/PG_81301.java @@ -0,0 +1,39 @@ +import java.util.HashMap; + +# 1 +class Solution { + + private static HashMap map = new HashMap<>(); + + public int solution(String s) { + // map 구성 + map.put("zero", "0"); + map.put("one", "1"); + map.put("two", "2"); + map.put("three", "3"); + map.put("four", "4"); + map.put("five", "5"); + map.put("six", "6"); + map.put("seven", "7"); + map.put("eight", "8"); + map.put("nine", "9"); + + for(String key : map.keySet()){ + s = s.replaceAll(key, map.get(key)); + } + + int answer = Integer.parseInt(s); + return answer; + } +} + +# 2 +class Solution { + public int solution(String s) { + String[] strArr = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}; + for(int i = 0; i < strArr.length; i++) { + s = s.replaceAll(strArr[i], Integer.toString(i)); + } + return Integer.parseInt(s); + } +} From af14ec15cb38d7c5b8d1b796ddd31c0ef6e9d1a7 Mon Sep 17 00:00:00 2001 From: haemin4738 <132271194+haemin4738@users.noreply.github.com> Date: Tue, 8 Jul 2025 11:20:45 +0900 Subject: [PATCH 2/8] Update PG_81301.java --- src/week02/haemin/PG_81301.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/week02/haemin/PG_81301.java b/src/week02/haemin/PG_81301.java index d716606..86fee89 100644 --- a/src/week02/haemin/PG_81301.java +++ b/src/week02/haemin/PG_81301.java @@ -1,6 +1,6 @@ import java.util.HashMap; -# 1 +// 1 class Solution { private static HashMap map = new HashMap<>(); @@ -27,8 +27,8 @@ public int solution(String s) { } } -# 2 -class Solution { +// 2 +class Solution2 { public int solution(String s) { String[] strArr = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}; for(int i = 0; i < strArr.length; i++) { From 21329061836b5508da09086af35e6af39ba8590f Mon Sep 17 00:00:00 2001 From: haemin4738 <132271194+haemin4738@users.noreply.github.com> Date: Tue, 8 Jul 2025 11:23:25 +0900 Subject: [PATCH 3/8] Update PG_81301.java --- src/week02/haemin/PG_81301.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/week02/haemin/PG_81301.java b/src/week02/haemin/PG_81301.java index 86fee89..01cc354 100644 --- a/src/week02/haemin/PG_81301.java +++ b/src/week02/haemin/PG_81301.java @@ -28,12 +28,12 @@ public int solution(String s) { } // 2 -class Solution2 { - public int solution(String s) { - String[] strArr = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}; - for(int i = 0; i < strArr.length; i++) { - s = s.replaceAll(strArr[i], Integer.toString(i)); - } - return Integer.parseInt(s); - } -} +//class Solution2 { +// public int solution(String s) { +// String[] strArr = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}; +// for(int i = 0; i < strArr.length; i++) { +// s = s.replaceAll(strArr[i], Integer.toString(i)); +// } +// return Integer.parseInt(s); +// } +//} From 8353ae727e319db960bc2559f3e2109793514dfd Mon Sep 17 00:00:00 2001 From: haemin4738 <132271194+haemin4738@users.noreply.github.com> Date: Tue, 8 Jul 2025 11:24:20 +0900 Subject: [PATCH 4/8] Update PG_81301.java --- src/week02/haemin/PG_81301.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/week02/haemin/PG_81301.java b/src/week02/haemin/PG_81301.java index 01cc354..429fe0b 100644 --- a/src/week02/haemin/PG_81301.java +++ b/src/week02/haemin/PG_81301.java @@ -1,4 +1,5 @@ import java.util.HashMap; +import java.util.*; // 1 class Solution { From 3d9c4655a6c2f3ada73cc323bed4f39a6fe62780 Mon Sep 17 00:00:00 2001 From: haemin4738 <132271194+haemin4738@users.noreply.github.com> Date: Tue, 8 Jul 2025 11:26:55 +0900 Subject: [PATCH 5/8] Update PG_81301.java --- src/week02/haemin/PG_81301.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/week02/haemin/PG_81301.java b/src/week02/haemin/PG_81301.java index 429fe0b..eb65a94 100644 --- a/src/week02/haemin/PG_81301.java +++ b/src/week02/haemin/PG_81301.java @@ -6,7 +6,7 @@ class Solution { private static HashMap map = new HashMap<>(); - public int solution(String s) { + public int solution1(String s) { // map 구성 map.put("zero", "0"); map.put("one", "1"); From 37919f43d5a6c9bf09de4ee76f15dd303594b185 Mon Sep 17 00:00:00 2001 From: haemin4738 <132271194+haemin4738@users.noreply.github.com> Date: Tue, 8 Jul 2025 11:29:49 +0900 Subject: [PATCH 6/8] Update PG_81301.java --- src/week02/haemin/PG_81301.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/week02/haemin/PG_81301.java b/src/week02/haemin/PG_81301.java index eb65a94..714f69d 100644 --- a/src/week02/haemin/PG_81301.java +++ b/src/week02/haemin/PG_81301.java @@ -1,6 +1,6 @@ import java.util.HashMap; import java.util.*; - +package week02.Haemin; // 1 class Solution { From 2da9954fea8c9aeb2f174854e6b9a700c16caf34 Mon Sep 17 00:00:00 2001 From: haemin4738 <132271194+haemin4738@users.noreply.github.com> Date: Tue, 8 Jul 2025 11:30:51 +0900 Subject: [PATCH 7/8] Update PG_81301.java --- src/week02/haemin/PG_81301.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/week02/haemin/PG_81301.java b/src/week02/haemin/PG_81301.java index 714f69d..23e3e57 100644 --- a/src/week02/haemin/PG_81301.java +++ b/src/week02/haemin/PG_81301.java @@ -1,6 +1,6 @@ import java.util.HashMap; import java.util.*; -package week02.Haemin; +package week02.haemin; // 1 class Solution { From d6b9c03f7416d4193466bf1b0cb89e783c966f0f Mon Sep 17 00:00:00 2001 From: haemin4738 <132271194+haemin4738@users.noreply.github.com> Date: Tue, 8 Jul 2025 11:31:58 +0900 Subject: [PATCH 8/8] Update PG_81301.java --- src/week02/haemin/PG_81301.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/week02/haemin/PG_81301.java b/src/week02/haemin/PG_81301.java index 23e3e57..f33696e 100644 --- a/src/week02/haemin/PG_81301.java +++ b/src/week02/haemin/PG_81301.java @@ -1,6 +1,8 @@ +package week02.haemin; + import java.util.HashMap; import java.util.*; -package week02.haemin; + // 1 class Solution {