From 1c88a82315fdb7bb9d648f39b48eb3ca0e028817 Mon Sep 17 00:00:00 2001 From: hoonji choi Date: Thu, 2 Jul 2026 19:04:43 -0700 Subject: [PATCH 1/6] 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/6] 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/6] 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/6] 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/6] 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/6] 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; - } -}