Skip to content

fix(security): 2 improvements across 2 files#2612

Closed
tomaioo wants to merge 2 commits into
DaleStudy:mainfrom
tomaioo:fix/security/syntax-error-invalid-return-statement-in
Closed

fix(security): 2 improvements across 2 files#2612
tomaioo wants to merge 2 commits into
DaleStudy:mainfrom
tomaioo:fix/security/syntax-error-invalid-return-statement-in

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented May 23, 2026

Summary

fix(security): 2 improvements across 2 files

Problem

Severity: High | File: 3sum/tedkimdev.go:L42

In tedkimdev.go, the function contains return result.keys() at the end, which is invalid Go syntax. Maps in Go do not have a .keys() method. This would cause a compilation error. The correct approach would be to iterate over the map and build the slice, or use the already-built filteredResult variable.

Solution

Replace return result.keys() with return filteredResult since filteredResult is already correctly populated in the lines above.

Changes

  • 3sum/tedkimdev.go (modified)
  • 3sum/lhc0506.js (modified)

tomaioo added 2 commits May 23, 2026 05:16
- Security: Syntax Error: Invalid return statement in Go file
- Security: Undefined variable 'seen' in JavaScript file

Signed-off-by: tomaioo <[email protected]>
- Security: Syntax Error: Invalid return statement in Go file
- Security: Undefined variable 'seen' in JavaScript file

Signed-off-by: tomaioo <[email protected]>
@dalestudy
Copy link
Copy Markdown
Contributor

dalestudy Bot commented May 23, 2026

⚠️ Week 섀정이 λˆ„λ½λ˜μ—ˆμŠ΅λ‹ˆλ‹€

ν”„λ‘œμ νŠΈμ—μ„œ Weekλ₯Ό μ„€μ •ν•΄μ£Όμ„Έμš”!

μ„€μ • 방법

  1. PR 우츑의 Projects μ„Ήμ…˜μ—μ„œ λ¦¬νŠΈμ½”λ“œ μŠ€ν„°λ”” μ˜† λ“œλ‘­λ‹€μš΄(β–Ό) 클릭
  2. ν˜„μž¬ μ£Όμ°¨λ₯Ό μ„ νƒν•΄μ£Όμ„Έμš” (예: Week 14(current) λ˜λŠ” Week 14)

πŸ“š μžμ„Έν•œ κ°€μ΄λ“œ 보기


πŸ€– 이 λŒ“κΈ€μ€ GitHub App을 톡해 μžλ™μœΌλ‘œ μž‘μ„±λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

Comment thread 3sum/lhc0506.js
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏷️ μ•Œκ³ λ¦¬μ¦˜ νŒ¨ν„΄ 뢄석

  • νŒ¨ν„΄: Two Pointers
  • μ„€λͺ…: 이 μ½”λ“œλŠ” μ •λ ¬λœ λ°°μ—΄μ—μ„œ 두 포인터λ₯Ό ν™œμš©ν•˜μ—¬ 3개의 수의 합이 0이 λ˜λŠ” 쑰합을 μ°ΎλŠ” λ°©μ‹μœΌλ‘œ, Two Pointers νŒ¨ν„΄μ— μ†ν•©λ‹ˆλ‹€. 효율적인 탐색을 μœ„ν•΄ 쀑볡 μ œκ±°μ™€ 정렬을 ν™œμš©ν•©λ‹ˆλ‹€.

πŸ“Š μ‹œκ°„/곡간 λ³΅μž‘λ„ 뢄석

λ³΅μž‘λ„
Time O(n^2)
Space O(n)

ν”Όλ“œλ°±: 이 κ΅¬ν˜„μ€ 이쀑 반볡문과 ν•΄μ‹œμ…‹μ„ μ‚¬μš©ν•˜μ—¬ 쀑볡을 λ°©μ§€ν•˜λ©°, μ‹œκ°„ λ³΅μž‘λ„λŠ” 두 반볡문이 각각 O(n)이고 ν•΄μ‹œμ…‹ 연산이 평균 O(1)이기 λ•Œλ¬Έμ— O(n^2)μž…λ‹ˆλ‹€. 곡간은 ν•΄μ‹œμ…‹κ³Ό κ²°κ³Ό μ €μž₯에 O(n)μž…λ‹ˆλ‹€.

κ°œμ„  μ œμ•ˆ: ν˜„μž¬ κ΅¬ν˜„μ΄ μ μ ˆν•΄ λ³΄μž…λ‹ˆλ‹€.

πŸ’‘ 풀이에 μ‹œκ°„/곡간 λ³΅μž‘λ„λ₯Ό μ£Όμ„μœΌλ‘œ λ‚¨κ²¨λ³΄μ„Έμš”!

Comment thread 3sum/tedkimdev.go
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏷️ μ•Œκ³ λ¦¬μ¦˜ νŒ¨ν„΄ 뢄석

  • νŒ¨ν„΄: Two Pointers
  • μ„€λͺ…: 이 μ½”λ“œλŠ” μ •λ ¬λœ λ°°μ—΄μ—μ„œ 두 포인터λ₯Ό ν™œμš©ν•˜μ—¬ 3개의 수의 합이 0이 λ˜λŠ” 쑰합을 μ°ΎλŠ” λ°©μ‹μœΌλ‘œ, 효율적인 탐색을 μœ„ν•΄ Two Pointers νŒ¨ν„΄μ„ μ‚¬μš©ν•©λ‹ˆλ‹€.

πŸ“Š μ‹œκ°„/곡간 λ³΅μž‘λ„ 뢄석

λ³΅μž‘λ„
Time O(n^2)
Space O(n)

ν”Όλ“œλ°±: 이 κ΅¬ν˜„μ€ 이쀑 반볡문과 ν•΄μ‹œμ…‹μ„ μ‚¬μš©ν•˜μ—¬ 쀑볡을 λ°©μ§€ν•˜λ©°, μ‹œκ°„ λ³΅μž‘λ„λŠ” 두 반볡문이 각각 O(n)이고 ν•΄μ‹œμ…‹ 연산이 평균 O(1)이기 λ•Œλ¬Έμ— O(n^2)μž…λ‹ˆλ‹€. 곡간은 ν•΄μ‹œμ…‹κ³Ό κ²°κ³Ό μ €μž₯에 O(n)μž…λ‹ˆλ‹€.

κ°œμ„  μ œμ•ˆ: ν˜„μž¬ κ΅¬ν˜„μ΄ μ μ ˆν•΄ λ³΄μž…λ‹ˆλ‹€.

πŸ’‘ 풀이에 μ‹œκ°„/곡간 λ³΅μž‘λ„λ₯Ό μ£Όμ„μœΌλ‘œ λ‚¨κ²¨λ³΄μ„Έμš”!

@DaleSeo
Copy link
Copy Markdown
Member

DaleSeo commented May 23, 2026

@tomaioo The changes aren't security-related despite the PR title. This is a study repo where each member submits only their own solutions under their own filename. We don't accept external fixes to other members' submissions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants