From 1c88a82315fdb7bb9d648f39b48eb3ca0e028817 Mon Sep 17 00:00:00 2001 From: hoonji choi Date: Thu, 2 Jul 2026 19:04:43 -0700 Subject: [PATCH 1/8] valid-anagram --- valid-anagram/hoonjichoi1.java | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 valid-anagram/hoonjichoi1.java diff --git a/valid-anagram/hoonjichoi1.java b/valid-anagram/hoonjichoi1.java new file mode 100644 index 0000000000..d6b18461a0 --- /dev/null +++ b/valid-anagram/hoonjichoi1.java @@ -0,0 +1,39 @@ +import java.util.HashMap; + +public class hoonjichoi1 { + public boolean isAnagram(String s, String t) { + if (s.equals(t)) + return true; + if (s.length() != t.length()) + return false; + + HashMap map = new HashMap<>(); + + for (int i = 0; i < s.length(); i++) { + Character c = s.charAt(i); + if (map.containsKey(c)) { + int value = map.get(c) + 1; + map.put(c, value); + } else { + map.put(c, 1); + } + } + + for (int j = 0; j < t.length(); j++) { + Character c2 = t.charAt(j); + if (map.containsKey(c2)) { + int value = map.get(c2) - 1; + map.put(c2, value); + } else { + return false; + } + } + + for (Integer i : map.values()) { + if (i < 0) { + return false; + } + } + return true; + } +} From 814c06bd2130e60830f034c903b69d7437ede83a Mon Sep 17 00:00:00 2001 From: hoonji choi Date: Thu, 2 Jul 2026 19:42:01 -0700 Subject: [PATCH 2/8] climbing-stairs --- climbing-stairs/hoonjichoi.java | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 climbing-stairs/hoonjichoi.java diff --git a/climbing-stairs/hoonjichoi.java b/climbing-stairs/hoonjichoi.java new file mode 100644 index 0000000000..bf7e121ef9 --- /dev/null +++ b/climbing-stairs/hoonjichoi.java @@ -0,0 +1,25 @@ +/* +f(45) = f(44) + f(43) +f(44) = f(43) + f(42) +. +. +. +f(3) = f(2) + f(1) +f(2) = 2 +f(1) = 1 +*/ +class Solution { + public int climbStairs(int n) { + if (n <= 2) return n; + + int prev = 1; + int result = 2; + int temp = 0; + for (int i = 2; i < n ; i++) { + temp = result; + result += prev; + prev = temp; + } + return result; + } +} \ No newline at end of file From cc3e002d89f74d3c2a788791d8f4c9282f7ced4c Mon Sep 17 00:00:00 2001 From: hoonji choi Date: Thu, 2 Jul 2026 19:45:01 -0700 Subject: [PATCH 3/8] climbing-stairs --- climbing-stairs/hoonjichoi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/climbing-stairs/hoonjichoi.java b/climbing-stairs/hoonjichoi.java index bf7e121ef9..7c0b38f4cf 100644 --- a/climbing-stairs/hoonjichoi.java +++ b/climbing-stairs/hoonjichoi.java @@ -22,4 +22,4 @@ public int climbStairs(int n) { } return result; } -} \ No newline at end of file +} From 34ec223f0be28858b4567632aa59de63290e1836 Mon Sep 17 00:00:00 2001 From: hoonji choi Date: Thu, 2 Jul 2026 22:29:16 -0700 Subject: [PATCH 4/8] climbing-stairs --- climbing-stairs/hoonjichoi.java | 1 + 1 file changed, 1 insertion(+) diff --git a/climbing-stairs/hoonjichoi.java b/climbing-stairs/hoonjichoi.java index 7c0b38f4cf..7533ffc17f 100644 --- a/climbing-stairs/hoonjichoi.java +++ b/climbing-stairs/hoonjichoi.java @@ -1,3 +1,4 @@ + /* f(45) = f(44) + f(43) f(44) = f(43) + f(42) From 1cfbf8262205b34758289eb45a6d575e7946e0aa Mon Sep 17 00:00:00 2001 From: hoonji choi Date: Thu, 2 Jul 2026 22:33:24 -0700 Subject: [PATCH 5/8] climbing-stairs --- climbing-stairs/hoonjichoi1.java | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 climbing-stairs/hoonjichoi1.java diff --git a/climbing-stairs/hoonjichoi1.java b/climbing-stairs/hoonjichoi1.java new file mode 100644 index 0000000000..7533ffc17f --- /dev/null +++ b/climbing-stairs/hoonjichoi1.java @@ -0,0 +1,26 @@ + +/* +f(45) = f(44) + f(43) +f(44) = f(43) + f(42) +. +. +. +f(3) = f(2) + f(1) +f(2) = 2 +f(1) = 1 +*/ +class Solution { + public int climbStairs(int n) { + if (n <= 2) return n; + + int prev = 1; + int result = 2; + int temp = 0; + for (int i = 2; i < n ; i++) { + temp = result; + result += prev; + prev = temp; + } + return result; + } +} From 6386bf39162ca439f1ad4df18a45813e8358c4fe Mon Sep 17 00:00:00 2001 From: hoonji choi Date: Fri, 3 Jul 2026 12:02:25 -0700 Subject: [PATCH 6/8] remove old filename --- climbing-stairs/hoonjichoi.java | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 climbing-stairs/hoonjichoi.java diff --git a/climbing-stairs/hoonjichoi.java b/climbing-stairs/hoonjichoi.java deleted file mode 100644 index 7533ffc17f..0000000000 --- a/climbing-stairs/hoonjichoi.java +++ /dev/null @@ -1,26 +0,0 @@ - -/* -f(45) = f(44) + f(43) -f(44) = f(43) + f(42) -. -. -. -f(3) = f(2) + f(1) -f(2) = 2 -f(1) = 1 -*/ -class Solution { - public int climbStairs(int n) { - if (n <= 2) return n; - - int prev = 1; - int result = 2; - int temp = 0; - for (int i = 2; i < n ; i++) { - temp = result; - result += prev; - prev = temp; - } - return result; - } -} From daee88b0449c9f5062331cfa2d2098ef69737e8a Mon Sep 17 00:00:00 2001 From: Hoonji Choi Date: Sun, 5 Jul 2026 15:59:21 -0700 Subject: [PATCH 7/8] Feedback updated valid-anagram/hoonjichoi1.java Co-authored-by: Hojeong Park --- valid-anagram/hoonjichoi1.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/valid-anagram/hoonjichoi1.java b/valid-anagram/hoonjichoi1.java index d6b18461a0..a69ff47abb 100644 --- a/valid-anagram/hoonjichoi1.java +++ b/valid-anagram/hoonjichoi1.java @@ -11,22 +11,16 @@ public boolean isAnagram(String s, String t) { for (int i = 0; i < s.length(); i++) { Character c = s.charAt(i); - if (map.containsKey(c)) { - int value = map.get(c) + 1; - map.put(c, value); - } else { - map.put(c, 1); - } + map.put(c, map.getOrDefault(c, 0) + 1); } for (int j = 0; j < t.length(); j++) { - Character c2 = t.charAt(j); - if (map.containsKey(c2)) { - int value = map.get(c2) - 1; - map.put(c2, value); - } else { + Character c = t.charAt(j); + if (!map.containsKey(c) || map.get(c) <= 0) { return false; } + + map.put(c, map.get(c) - 1); } for (Integer i : map.values()) { From dd0e8ec068b4e9292aab4f4fe61f9482697c391c Mon Sep 17 00:00:00 2001 From: Hoonji Choi Date: Sun, 5 Jul 2026 16:00:21 -0700 Subject: [PATCH 8/8] Feedback updated climbing-stairs/hoonjichoi1.java Co-authored-by: Hojeong Park --- climbing-stairs/hoonjichoi1.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/climbing-stairs/hoonjichoi1.java b/climbing-stairs/hoonjichoi1.java index 7533ffc17f..0af34fef6c 100644 --- a/climbing-stairs/hoonjichoi1.java +++ b/climbing-stairs/hoonjichoi1.java @@ -13,14 +13,12 @@ class Solution { public int climbStairs(int n) { if (n <= 2) return n; - int prev = 1; - int result = 2; - int temp = 0; + int prev = 1, cur = 2; for (int i = 2; i < n ; i++) { - temp = result; - result += prev; + int temp = cur; + cur += prev; prev = temp; } - return result; + return cur; } }