From 37aea4bf6a7c7c396055b62069c6af2a10fc02f4 Mon Sep 17 00:00:00 2001 From: Hyeri1ee Date: Thu, 5 Mar 2026 20:52:03 +0900 Subject: [PATCH 1/5] add solution week1>Contains Duplicate --- contains-duplicate/hyeri1ee.java | 14 ++++++ dalestudy.iml | 85 ++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 contains-duplicate/hyeri1ee.java create mode 100644 dalestudy.iml diff --git a/contains-duplicate/hyeri1ee.java b/contains-duplicate/hyeri1ee.java new file mode 100644 index 0000000000..f746f02681 --- /dev/null +++ b/contains-duplicate/hyeri1ee.java @@ -0,0 +1,14 @@ +import java.util.*; + +class Solution { + Set save = new HashSet<>();//O(1)에 이미 등장했는지 판별 위함 + public boolean containsDuplicate(int[] nums) { + + for(int i=0; i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From ada8115c0181365838182032b6291c7272f6b352 Mon Sep 17 00:00:00 2001 From: Hyeri1ee Date: Thu, 5 Mar 2026 21:45:04 +0900 Subject: [PATCH 2/5] fix line lint --- dalestudy.iml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dalestudy.iml b/dalestudy.iml index 5ea48dee00..8283879532 100644 --- a/dalestudy.iml +++ b/dalestudy.iml @@ -82,4 +82,4 @@ - \ No newline at end of file + From ea8370d73eabb97bc30152bd7c6b0debfe59b436 Mon Sep 17 00:00:00 2001 From: Hyeri1ee Date: Thu, 5 Mar 2026 21:47:01 +0900 Subject: [PATCH 3/5] Remove IDE module file dalestudy.iml from repo --- dalestudy.iml | 85 --------------------------------------------------- 1 file changed, 85 deletions(-) delete mode 100644 dalestudy.iml diff --git a/dalestudy.iml b/dalestudy.iml deleted file mode 100644 index 8283879532..0000000000 --- a/dalestudy.iml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From c83f6b456a5aa4e1ba6f03ee56e9aede73c1886f Mon Sep 17 00:00:00 2001 From: Hyeri1ee Date: Thu, 5 Mar 2026 23:39:53 +0900 Subject: [PATCH 4/5] add solution week1>Two Sum --- dalestudy.iml | 85 +++++++++++++++++++++++++++++++++++++++++++ two-sum/Hyeri1ee.java | 24 ++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 dalestudy.iml create mode 100644 two-sum/Hyeri1ee.java diff --git a/dalestudy.iml b/dalestudy.iml new file mode 100644 index 0000000000..8283879532 --- /dev/null +++ b/dalestudy.iml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/two-sum/Hyeri1ee.java b/two-sum/Hyeri1ee.java new file mode 100644 index 0000000000..c7716502bf --- /dev/null +++ b/two-sum/Hyeri1ee.java @@ -0,0 +1,24 @@ +import java.util.*; +//goal : 두개의 인덱스 반환 +class Solution { + static int[] answer = new int[2]; + public int[] twoSum(int[] nums, int target) { + Map maps = new HashMap<>();//num , index + for(int i = 0; i < nums.length; i++){ + int t = target - nums[i]; //새로운 타겟 + //O(1)으로 다음 부분 찾기 + if (maps.containsKey(t)){ + answer[0] = i; + answer[1] = maps.get(t); + + Arrays.sort(answer); + return answer; + } + + maps.put(nums[i], i); + } + + return answer; + + } +} From f9957ea0192e54f77fb0cfdf672f7fe6fe85842d Mon Sep 17 00:00:00 2001 From: Hyeri Lee <108603070+Hyeri1ee@users.noreply.github.com> Date: Thu, 5 Mar 2026 23:54:00 +0900 Subject: [PATCH 5/5] Delete dalestudy.iml --- dalestudy.iml | 85 --------------------------------------------------- 1 file changed, 85 deletions(-) delete mode 100644 dalestudy.iml diff --git a/dalestudy.iml b/dalestudy.iml deleted file mode 100644 index 8283879532..0000000000 --- a/dalestudy.iml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -