Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
53 changes: 53 additions & 0 deletions longest-substring-without-repeating-characters/haung921209.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 연관 링크
- [문제 풀이 스케줄](https://github.com/orgs/DaleStudy/projects/6/views/5)
- [답안 코드 제출법](https://github.com/DaleStudy/leetcode-study/wiki/%EB%8B%B5%EC%95%88-%EC%A0%9C%EC%B6%9C-%EA%B0%80%EC%9D%B4%EB%93%9C)

# Problem
- 문제 링크 : https://leetcode.com/problems/longest-substring-without-repeating-characters/description/
- 문제 이름 : Longest Substring Without Repeating Characters
- 문제 번호 :3
- 난이도 : medium
- 카테고리 :

# 아이디어
- 마지막 위치에 대한 저장을 통한 빠른 탐색

# ✅ 코드 (Solution)

```cpp
class Solution {
public:
int lengthOfLongestSubstring(string s) {
unordered_map<char, int> latestIdx;
int maxLength = 0;
int start = 0;
for(int idx = 0; idx<s.size();idx++){
char curC = s[idx];
if(latestIdx.find(curC) != latestIdx.end() && latestIdx[curC] >= start){
start = latestIdx[curC]+1;
}
latestIdx[curC] = idx;
maxLength = max(maxLength, idx-start+1);
}
return maxLength;

}
};

```

# 🔍 코드 설명


# 최적화 포인트 (Optimality Discussion)
• 최적화한 이유와 원리
• 더 줄일 수 있는 여지는 있는가?
• 기존 방법 대비 얼마나 효율적이었는지

# 🧪 테스트 & 엣지 케이스

# 📚 관련 지식 복습

# 🔁 회고


63 changes: 63 additions & 0 deletions reverse-linked-list/haung921209.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# 연관 링크
- [문제 풀이 스케줄](https://github.com/orgs/DaleStudy/projects/6/views/5)
- [답안 코드 제출법](https://github.com/DaleStudy/leetcode-study/wiki/%EB%8B%B5%EC%95%88-%EC%A0%9C%EC%B6%9C-%EA%B0%80%EC%9D%B4%EB%93%9C)

# Problem
- 문제 링크 : https://leetcode.com/problems/reverse-linked-list/description/
- 문제 이름 : reverse-linked-list
- 문제 번호 : 206
- 난이도 : easy
- 카테고리 :

# 아이디어
- 어떤 방법으로 접근했는지 서술
- 포스 vs 최적화 아이디어 차이 등
- 잡도에 대한 고려

# ✅ 코드 (Solution)

```cpp
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* reverseListSubFunc(ListNode* before, ListNode* after){
if(!after){
return before;
}

auto next = after->next;
after->next = before;
return reverseListSubFunc(after, next);
}

ListNode* reverseList(ListNode* head) {
return reverseListSubFunc(nullptr, head);
}
};
```


# 🔍 코드 설명


# 최적화 포인트 (Optimality Discussion)
• 최적화한 이유와 원리
• 더 줄일 수 있는 여지는 있는가?
• 기존 방법 대비 얼마나 효율적이었는지

# 🧪 테스트 & 엣지 케이스

# 📚 관련 지식 복습

# 🔁 회고