Skip to content

Commit d336f17

Browse files
committed
2 parents 7c854cb + 5c133f4 commit d336f17

873 files changed

Lines changed: 29461 additions & 212 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

β€Ž.github/workflows/integration.yamlβ€Ž

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ name: Integration πŸ”„
22

33
on:
44
pull_request:
5+
merge_group:
56

67
jobs:
78
linelint:
89
runs-on: ubuntu-latest
10+
if: github.event_name == 'pull_request'
911
steps:
1012
- uses: actions/checkout@v4
1113
with:
@@ -17,11 +19,11 @@ jobs:
1719
run: |
1820
echo "πŸ” PR 번호: ${{ github.event.pull_request.number }}"
1921
pr_number="${{ github.event.pull_request.number }}"
20-
22+
2123
echo "πŸ“‹ PR 라벨 쑰회 쀑..."
2224
labels_json=$(gh pr view $pr_number --json labels -q '.labels[].name')
2325
echo "ν™•μΈλœ 라벨: $labels_json"
24-
26+
2527
if [ -n "$labels_json" ]; then
2628
has_maintenance=$(echo $labels_json | grep -q 'maintenance' && echo 'true' || echo 'false')
2729
echo "maintenance 라벨 포함 μ—¬λΆ€: $has_maintenance"
Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
name: Management πŸ”§
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
action:
7+
description: "Action to perform"
8+
required: true
9+
type: choice
10+
default: "approve-prs"
11+
options:
12+
- approve-prs
13+
- merge-prs
14+
week:
15+
description: 'Week number to filter (optional, e.g., "1")'
16+
required: false
17+
type: string
18+
default: ""
19+
exclude_prs:
20+
description: 'PR numbers to exclude (comma-separated, e.g., "1972,1973")'
21+
required: false
22+
type: string
23+
default: ""
24+
25+
jobs:
26+
approve-prs:
27+
name: Approve Open PRs πŸ‘
28+
runs-on: ubuntu-latest
29+
if: ${{ inputs.action == 'approve-prs' }}
30+
permissions:
31+
contents: read
32+
33+
steps:
34+
- name: Approve PRs via GitHub App
35+
id: approve
36+
run: |
37+
echo "πŸ‘ GitHub App을 톡해 λͺ¨λ“  Open PR 승인 쀑..."
38+
39+
# Parse exclude_prs input into JSON array
40+
exclude_input="${{ inputs.exclude_prs }}"
41+
if [ -z "$exclude_input" ]; then
42+
excludes="[]"
43+
else
44+
# Convert "1972,1973" to [1972,1973]
45+
excludes="[$(echo "$exclude_input" | sed 's/,/, /g')]"
46+
fi
47+
48+
# Build request payload
49+
week_input="${{ inputs.week }}"
50+
if [ -z "$week_input" ]; then
51+
payload="{\"repo_name\": \"${{ github.event.repository.name }}\", \"excludes\": $excludes}"
52+
else
53+
payload="{\"repo_name\": \"${{ github.event.repository.name }}\", \"week\": \"Week $week_input\", \"excludes\": $excludes}"
54+
fi
55+
56+
echo "μ£Όμ°¨ ν•„ν„°: ${week_input:-전체}"
57+
echo "μ œμ™Έν•  PR: $excludes"
58+
59+
response=$(curl -s -X POST "https://github.dalestudy.com/approve-prs" \
60+
-H "Content-Type: application/json" \
61+
-d "$payload")
62+
63+
echo "response=$response" >> $GITHUB_OUTPUT
64+
echo "$response" | jq '.'
65+
66+
- name: Summary
67+
run: |
68+
response='${{ steps.approve.outputs.response }}'
69+
70+
success=$(echo "$response" | jq -r '.success // false')
71+
total=$(echo "$response" | jq -r '.total_open_prs // 0')
72+
week_filter=$(echo "$response" | jq -r '.week_filter // null')
73+
week_matched=$(echo "$response" | jq -r '.week_matched // 0')
74+
week_mismatched=$(echo "$response" | jq -r '.week_mismatched // 0')
75+
solving_excluded=$(echo "$response" | jq -r '.solving_excluded // 0')
76+
processed=$(echo "$response" | jq -r '.processed // 0')
77+
approved=$(echo "$response" | jq -r '.approved // 0')
78+
skipped=$(echo "$response" | jq -r '.skipped // 0')
79+
80+
echo "## πŸ‘ PR 승인 μ™„λ£Œ" >> $GITHUB_STEP_SUMMARY
81+
echo "" >> $GITHUB_STEP_SUMMARY
82+
83+
if [ "$success" = "true" ]; then
84+
echo "βœ… **μ„±κ³΅μ μœΌλ‘œ μ™„λ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€**" >> $GITHUB_STEP_SUMMARY
85+
else
86+
echo "❌ **였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€**" >> $GITHUB_STEP_SUMMARY
87+
fi
88+
89+
echo "" >> $GITHUB_STEP_SUMMARY
90+
if [ "$week_filter" != "null" ]; then
91+
echo "- πŸ—“οΈ μ£Όμ°¨ ν•„ν„°: **$week_filter**" >> $GITHUB_STEP_SUMMARY
92+
fi
93+
echo "- πŸ“‹ 전체 Open PR: **$total**개" >> $GITHUB_STEP_SUMMARY
94+
if [ "$week_filter" != "null" ]; then
95+
echo "- βœ… $week_filter λ§€μΉ­: **$week_matched**개" >> $GITHUB_STEP_SUMMARY
96+
echo "- ❌ Week 뢈일치: **$week_mismatched**개" >> $GITHUB_STEP_SUMMARY
97+
echo "- πŸ”„ Solving μƒνƒœ μ œμ™Έ: **$solving_excluded**개" >> $GITHUB_STEP_SUMMARY
98+
fi
99+
echo "- πŸ” κ²€μ‚¬ν•œ PR: **$processed**개" >> $GITHUB_STEP_SUMMARY
100+
echo "- βœ… μŠΉμΈν•œ PR: **$approved**개" >> $GITHUB_STEP_SUMMARY
101+
echo "- ⏭️ κ±΄λ„ˆλ›΄ PR: **$skipped**개" >> $GITHUB_STEP_SUMMARY
102+
103+
# Show detailed results if available
104+
result_count=$(echo "$response" | jq -r '.results | length')
105+
if [ "$result_count" -gt 0 ]; then
106+
echo "" >> $GITHUB_STEP_SUMMARY
107+
echo "### πŸ“ 상세 κ²°κ³Ό" >> $GITHUB_STEP_SUMMARY
108+
echo "" >> $GITHUB_STEP_SUMMARY
109+
110+
echo "$response" | jq -c '.results[]' | while read -r item; do
111+
pr=$(echo "$item" | jq -r '.pr')
112+
title=$(echo "$item" | jq -r '.title')
113+
skipped=$(echo "$item" | jq -r '.skipped // false')
114+
approved=$(echo "$item" | jq -r '.approved // false')
115+
reason=$(echo "$item" | jq -r '.reason // ""')
116+
error=$(echo "$item" | jq -r '.error // ""')
117+
118+
if [ "$skipped" = "true" ]; then
119+
echo "- PR #$pr [$title]: ⏭️ skipped ($reason)" >> $GITHUB_STEP_SUMMARY
120+
elif [ "$approved" = "true" ]; then
121+
echo "- PR #$pr [$title]: βœ… approved" >> $GITHUB_STEP_SUMMARY
122+
else
123+
echo "- PR #$pr [$title]: ❌ failed (${error:-unknown})" >> $GITHUB_STEP_SUMMARY
124+
fi
125+
done
126+
fi
127+
128+
merge-prs:
129+
name: Merge Open PRs πŸš€
130+
runs-on: ubuntu-latest
131+
if: ${{ inputs.action == 'merge-prs' }}
132+
permissions:
133+
contents: read
134+
135+
steps:
136+
- name: Merge PRs via GitHub App
137+
id: merge
138+
run: |
139+
echo "πŸš€ GitHub App을 톡해 λͺ¨λ“  승인된 PR λ¨Έμ§€ 쀑..."
140+
141+
# Parse exclude_prs input into JSON array
142+
exclude_input="${{ inputs.exclude_prs }}"
143+
if [ -z "$exclude_input" ]; then
144+
excludes="[]"
145+
else
146+
# Convert "1972,1973" to [1972,1973]
147+
excludes="[$(echo "$exclude_input" | sed 's/,/, /g')]"
148+
fi
149+
150+
# Build request payload
151+
week_input="${{ inputs.week }}"
152+
merge_method="merge"
153+
154+
if [ -z "$week_input" ]; then
155+
payload="{\"repo_name\": \"${{ github.event.repository.name }}\", \"merge_method\": \"$merge_method\", \"excludes\": $excludes}"
156+
else
157+
payload="{\"repo_name\": \"${{ github.event.repository.name }}\", \"merge_method\": \"$merge_method\", \"week\": \"Week $week_input\", \"excludes\": $excludes}"
158+
fi
159+
160+
echo "λ¨Έμ§€ 방식: $merge_method"
161+
echo "μ£Όμ°¨ ν•„ν„°: ${week_input:-전체}"
162+
echo "μ œμ™Έν•  PR: $excludes"
163+
164+
response=$(curl -s -X POST "https://github.dalestudy.com/merge-prs" \
165+
-H "Content-Type: application/json" \
166+
-d "$payload")
167+
168+
echo "response=$response" >> $GITHUB_OUTPUT
169+
echo "$response" | jq '.'
170+
171+
- name: Summary
172+
run: |
173+
response='${{ steps.merge.outputs.response }}'
174+
175+
success=$(echo "$response" | jq -r '.success // false')
176+
total=$(echo "$response" | jq -r '.total_open_prs // 0')
177+
week_filter=$(echo "$response" | jq -r '.week_filter // null')
178+
week_matched=$(echo "$response" | jq -r '.week_matched // 0')
179+
week_mismatched=$(echo "$response" | jq -r '.week_mismatched // 0')
180+
solving_excluded=$(echo "$response" | jq -r '.solving_excluded // 0')
181+
processed=$(echo "$response" | jq -r '.processed // 0')
182+
merged=$(echo "$response" | jq -r '.merged // 0')
183+
skipped=$(echo "$response" | jq -r '.skipped // 0')
184+
merge_method=$(echo "$response" | jq -r '.merge_method // "unknown"')
185+
186+
echo "## πŸš€ PR λ¨Έμ§€ μ™„λ£Œ" >> $GITHUB_STEP_SUMMARY
187+
echo "" >> $GITHUB_STEP_SUMMARY
188+
189+
if [ "$success" = "true" ]; then
190+
echo "βœ… **μ„±κ³΅μ μœΌλ‘œ μ™„λ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€**" >> $GITHUB_STEP_SUMMARY
191+
else
192+
echo "❌ **였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€**" >> $GITHUB_STEP_SUMMARY
193+
fi
194+
195+
echo "" >> $GITHUB_STEP_SUMMARY
196+
echo "- πŸ”§ λ¨Έμ§€ 방식: **$merge_method**" >> $GITHUB_STEP_SUMMARY
197+
if [ "$week_filter" != "null" ]; then
198+
echo "- πŸ—“οΈ μ£Όμ°¨ ν•„ν„°: **$week_filter**" >> $GITHUB_STEP_SUMMARY
199+
fi
200+
echo "- πŸ“‹ 전체 Open PR: **$total**개" >> $GITHUB_STEP_SUMMARY
201+
if [ "$week_filter" != "null" ]; then
202+
echo "- βœ… $week_filter λ§€μΉ­: **$week_matched**개" >> $GITHUB_STEP_SUMMARY
203+
echo "- ❌ Week 뢈일치: **$week_mismatched**개" >> $GITHUB_STEP_SUMMARY
204+
echo "- πŸ”„ Solving μƒνƒœ μ œμ™Έ: **$solving_excluded**개" >> $GITHUB_STEP_SUMMARY
205+
fi
206+
echo "- πŸ” κ²€μ‚¬ν•œ PR: **$processed**개" >> $GITHUB_STEP_SUMMARY
207+
echo "- βœ… λ¨Έμ§€ν•œ PR: **$merged**개" >> $GITHUB_STEP_SUMMARY
208+
echo "- ⏭️ κ±΄λ„ˆλ›΄ PR: **$skipped**개" >> $GITHUB_STEP_SUMMARY
209+
210+
# Show detailed results if available
211+
result_count=$(echo "$response" | jq -r '.results | length')
212+
if [ "$result_count" -gt 0 ]; then
213+
echo "" >> $GITHUB_STEP_SUMMARY
214+
echo "### πŸ“ 상세 κ²°κ³Ό" >> $GITHUB_STEP_SUMMARY
215+
echo "" >> $GITHUB_STEP_SUMMARY
216+
217+
echo "$response" | jq -c '.results[]' | while read -r item; do
218+
pr=$(echo "$item" | jq -r '.pr')
219+
title=$(echo "$item" | jq -r '.title')
220+
skipped=$(echo "$item" | jq -r '.skipped // false')
221+
merged=$(echo "$item" | jq -r '.merged // false')
222+
reason=$(echo "$item" | jq -r '.reason // ""')
223+
error=$(echo "$item" | jq -r '.error // ""')
224+
225+
if [ "$skipped" = "true" ]; then
226+
echo "- PR #$pr [$title]: ⏭️ skipped ($reason)" >> $GITHUB_STEP_SUMMARY
227+
elif [ "$merged" = "true" ]; then
228+
echo "- PR #$pr [$title]: βœ… merged" >> $GITHUB_STEP_SUMMARY
229+
else
230+
echo "- PR #$pr [$title]: ❌ failed (${error:-unknown})" >> $GITHUB_STEP_SUMMARY
231+
fi
232+
done
233+
fi
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Week Check πŸ—“οΈ
2+
3+
on:
4+
schedule:
5+
# 맀일 μ˜€μ „ 10μ‹œ, μ˜€ν›„ 6μ‹œ (KST κΈ°μ€€, UTCλ‘œλŠ” 1μ‹œ, 9μ‹œ)
6+
- cron: "0 1,9 * * *"
7+
workflow_dispatch:
8+
9+
jobs:
10+
check-weeks:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
15+
steps:
16+
- name: Check all PRs via GitHub App
17+
id: check
18+
run: |
19+
echo "πŸ” GitHub App을 톡해 λͺ¨λ“  Open PR 검사 쀑..."
20+
21+
response=$(curl -s -X POST "https://github.dalestudy.com/check-weeks" \
22+
-H "Content-Type: application/json" \
23+
-d "{\"repo_owner\": \"${{ github.repository_owner }}\", \"repo_name\": \"${{ github.event.repository.name }}\"}")
24+
25+
echo "response=$response" >> $GITHUB_OUTPUT
26+
echo "$response" | jq '.'
27+
28+
- name: Summary
29+
run: |
30+
response='${{ steps.check.outputs.response }}'
31+
32+
total=$(echo "$response" | jq -r '.total_prs // 0')
33+
checked=$(echo "$response" | jq -r '.checked // 0')
34+
commented=$(echo "$response" | jq -r '.commented // 0')
35+
deleted=$(echo "$response" | jq -r '.deleted // 0')
36+
37+
echo "## 🎯 Week μ„€μ • 체크 μ™„λ£Œ" >> $GITHUB_STEP_SUMMARY
38+
echo "" >> $GITHUB_STEP_SUMMARY
39+
echo "- πŸ“‹ 전체 Open PR: **$total**개" >> $GITHUB_STEP_SUMMARY
40+
echo "- βœ… κ²€μ‚¬ν•œ PR: **$checked**개" >> $GITHUB_STEP_SUMMARY
41+
echo "- πŸ’¬ λŒ“κΈ€ μž‘μ„±ν•œ PR: **$commented**개" >> $GITHUB_STEP_SUMMARY
42+
echo "- πŸ—‘οΈ λŒ“κΈ€ μ‚­μ œν•œ PR: **$deleted**개" >> $GITHUB_STEP_SUMMARY
43+
echo "" >> $GITHUB_STEP_SUMMARY
44+
echo "λ‹€μŒ 체크: $(date -u -d '+1 hour' +'%Y-%m-%d %H:00 UTC')" >> $GITHUB_STEP_SUMMARY

β€Ž3sum/8804who.pyβ€Ž

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class Solution:
2+
def threeSum(self, nums: List[int]) -> List[List[int]]:
3+
temp = {}
4+
answer = {}
5+
nums.sort()
6+
for i in range(len(nums)):
7+
for j in range(i+1, len(nums)):
8+
if -(nums[i]+nums[j]) in temp:
9+
ans = str(nums[i])+','+str(nums[j])
10+
answer[ans] = 1
11+
temp[nums[i]] = 1
12+
temp_ans = []
13+
for ans in answer.keys():
14+
s1, s2 = ans.split(',')
15+
temp_ans.append([int(s1), int(s2), -(int(s1)+int(s2))])
16+
return temp_ans
17+

0 commit comments

Comments
Β (0)