Skip to content

[jaekwang97] WEEK 02 Solutions#2691

Merged
JAEKWANG97 merged 4 commits into
DaleStudy:mainfrom
JAEKWANG97:week-02-solutions
Jul 4, 2026
Merged

[jaekwang97] WEEK 02 Solutions#2691
JAEKWANG97 merged 4 commits into
DaleStudy:mainfrom
JAEKWANG97:week-02-solutions

Conversation

@JAEKWANG97

@JAEKWANG97 JAEKWANG97 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

๋‹ต์•ˆ ์ œ์ถœ ๋ฌธ์ œ

์ž‘์„ฑ์ž ์ฒดํฌ ๋ฆฌ์ŠคํŠธ

  • Projects์˜ ์˜ค๋ฅธ์ชฝ ๋ฒ„ํŠผ(โ–ผ)์„ ๋ˆŒ๋Ÿฌ ํ™•์žฅํ•œ ๋’ค, Week๋ฅผ ํ˜„์žฌ ์ฃผ์ฐจ๋กœ ์„ค์ •ํ•ด์ฃผ์„ธ์š”.
  • ๋ฌธ์ œ๋ฅผ ๋ชจ๋‘ ํ‘ธ์‹œ๋ฉด ํ”„๋กœ์ ํŠธ์—์„œ Status๋ฅผ In Review๋กœ ์„ค์ •ํ•ด์ฃผ์„ธ์š”.
  • ์ฝ”๋“œ ๊ฒ€ํ† ์ž 1๋ถ„ ์ด์ƒ์œผ๋กœ๋ถ€ํ„ฐ ์Šน์ธ์„ ๋ฐ›์œผ์…จ๋‹ค๋ฉด PR์„ ๋ณ‘ํ•ฉํ•ด์ฃผ์„ธ์š”.

๊ฒ€ํ† ์ž ์ฒดํฌ ๋ฆฌ์ŠคํŠธ

Important

๋ณธ์ธ ๋‹ต์•ˆ ์ œ์ถœ ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ๋‹ค๋ฅธ ๋ถ„ PR ํ•˜๋‚˜ ์ด์ƒ์„ ๋ฐ˜๋“œ์‹œ ๊ฒ€ํ† ๋ฅผ ํ•ด์ฃผ์…”์•ผ ํ•ฉ๋‹ˆ๋‹ค!

  • ๋ฐ”๋กœ ์ด์ „์— ์˜ฌ๋ผ์˜จ PR์— ๋ณธ์ธ์„ ์ฝ”๋“œ ๋ฆฌ๋ทฐ์–ด๋กœ ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”.
  • ๋ณธ์ธ์ด ๊ฒ€ํ† ํ•ด์•ผํ•˜๋Š” PR์˜ ๋‹ต์•ˆ ์ฝ”๋“œ์— ํ”ผ๋“œ๋ฐฑ์„ ์ฃผ์„ธ์š”.
  • ํ† ์š”์ผ ์ „๊นŒ์ง€ PR์„ ๋ณ‘ํ•ฉํ•  ์ˆ˜ ์žˆ๋„๋ก ์Šน์ธํ•ด์ฃผ์„ธ์š”.

@DaleSeo

DaleSeo commented Jul 1, 2026

Copy link
Copy Markdown
Member

@JAEKWANG97 #2691 (comment)

@namuuCY namuuCY self-requested a review July 1, 2026 16:59

@namuuCY namuuCY left a comment

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.

์šฐ์„  ์ง€๊ธˆ ํ’€๋ฆฐ ๋ฌธ์ œ๋“ค๊นŒ์ง€์˜ ๋ฆฌ๋ทฐ๋ฅผ ๋‹ฌ์•„๋‘์—ˆ์Šต๋‹ˆ๋‹ค!

Comment on lines +1 to +15
class Solution {
public int climbStairs(int n) {
int[] dp = new int[n + 1];
if (n <= 3) return n;
dp[1] = 1;
dp[2] = 2;
dp[3] = 3;

for (int i = 4; i <= n; i++) {
dp[i] = dp[i - 1] + dp[i - 2];
}

return dp[n];
}
}

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.

DP ์ •์„์ ์ธ ํ’€์ด๋Œ€๋กœ ์ž˜ ํ•˜์‹ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!
๋‹ค๋งŒ

  • ๋ช‡ ๋ฒˆ์งธ ํ•ญ์ด ์ดˆ๊ธฐํ•ญ์ด๊ณ , ์ดํ›„ ์–ด๋А ํ•ญ๋ถ€ํ„ฐ ์ ํ™”์‹์ด ์ ์šฉ๋˜๋Š”์ง€ ๋‹ค์‹œ ํ•œ๋ฒˆ ์‚ดํŽด๋ณด์‹œ๋Š” ๊ฒƒ๋„ ์ข‹์„๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
  • ์ง€๊ธˆ ์ด ํ’€์ด์—์„œ๋Š” n ์ดํ•˜์˜ ๋ชจ๋“  ๊ฐ’์„ ๋‹ค ์ €์žฅํ•˜๊ณ  ์žˆ๋Š”๋ฐ, ๊ตณ์ด ๋‹ค ์ €์žฅํ•  ํ•„์š”๊ฐ€ ์žˆ์„๊นŒ์š”? ์ €์žฅํ•˜์ง€ ์•Š๋Š” ํ’€์ด๋„ ํ•œ๋ฒˆ ์ƒ๊ฐํ•ด๋ณด์‹œ๋Š”๊ฑฐ ์–ด๋–จ๊นŒ์š”?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

๋ฆฌ๋ทฐ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!

๋ง์”€ํ•ด์ฃผ์‹  ๊ฒƒ์ฒ˜๋Ÿผ ์ง์ „ ๋‘ ๊ฐ’๋งŒ ์žˆ์œผ๋ฉด ๋‹ค์Œ ๊ฐ’์„ ๊ณ„์‚ฐํ•  ์ˆ˜ ์žˆ์–ด์„œ, ์ „์ฒด dp ๋ฐฐ์—ด์„ ์ €์žฅํ•˜์ง€ ์•Š๋Š” ๋ฐฉ์‹์œผ๋กœ ์ˆ˜์ •ํ•ด๋ดค์Šต๋‹ˆ๋‹ค. ์ดˆ๊ธฐํ•ญ๋„ n <= 2๋ฅผ ๋จผ์ € ์ฒ˜๋ฆฌํ•˜๊ณ , ์ดํ›„์—๋Š” prev, cur ๋‘ ๋ณ€์ˆ˜๋กœ ์ ํ™”์‹ ํ๋ฆ„์ด ๋ณด์ด๋„๋ก ์ •๋ฆฌํ–ˆ์Šต๋‹ˆ๋‹ค.

Comment on lines +1 to +26
import java.util.*;

class Solution {
public int[] productExceptSelf(int[] nums) {
int n = nums.length;
int[] right = new int[n + 1];
int[] left = new int[n + 1];

right[0] = 1;
for (int i = 1; i <= n; i++) {
right[i] = right[i - 1] * nums[i - 1];
}

left[n] = 1;
for (int i = n - 1; i >= 0; i--) {
left[i] = left[i + 1] * nums[i];
}

int[] answer = new int[n];
for (int i = 0; i < n; i++) {
answer[i] = right[i] * left[i + 1];
}

return answer;
}
}

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.

์ €๋Š” ์ฒ˜์Œ์— ์ž˜๋ชป๋œ ํ’€์ด(๋‚˜๋ˆ—์…ˆ์„ ์‚ฌ์šฉํ•œ)๋กœ ํ’€์—ˆ์—ˆ๋Š”๋ฐ,
@JAEKWANG97 ๋‹˜ ํ’€์ด๋ฅผ ๋ณด๊ณ  ์ œ๊ฐ€ ํ‹€๋ ธ๋‹ค๋Š”๊ฑธ ์•Œ๊ฒŒ๋์–ด์š”.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!

์ €๋„ ์ฒ˜์Œ์—๋Š” ์ „์ฒด ๊ณฑ์„ ๊ตฌํ•ด์„œ ๋‚˜๋ˆ„๋Š” ๋ฐฉ์‹์„ ๋จผ์ € ๋– ์˜ฌ๋ ธ๋Š”๋ฐ, ๋ฌธ์ œ ์กฐ๊ฑด ๋•Œ๋ฌธ์— ์™ผ์ชฝ ๋ˆ„์  ๊ณฑ๊ณผ ์˜ค๋ฅธ์ชฝ ๋ˆ„์  ๊ณฑ์„ ๋”ฐ๋กœ ๊ณ„์‚ฐํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์ ‘๊ทผํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ๋‚˜๋ˆ„๋ฉด 0์ด ํฌํ•จ๋œ ์ผ€์ด์Šค๋„ ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ ์ฒ˜๋ฆฌ๋ผ์„œ ์ข‹์•˜๋˜ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Comment thread 3sum/jaekwang97.java

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, Binary Search, Hash Map / Hash Set
  • ์„ค๋ช…: ์ •๋ ฌ ํ›„ ์ขŒ์šฐ ํฌ์ธํ„ฐ๋ฅผ ์ด์šฉํ•œ ํ•ฉ ํƒ์ƒ‰์œผ๋กœ 3ํ•ฉ์„ ์ฐพ๋Š” ๋Œ€ํ‘œ์  ํŒจํ„ด์ด๋‹ค. ์ค‘๋ณต ์ œ๊ฑฐ๋ฅผ ์œ„ํ•ด ํ•ด์‹œ ์„ธํŠธ์™€ ์Šคํ‚ต ๋กœ์ง์ด ์‚ฌ์šฉ๋œ๋‹ค.

๐Ÿ“Š ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„ ๋ถ„์„

๋ณต์žก๋„
Time O(n^2)
Space O(n)

ํ”ผ๋“œ๋ฐฑ: ์ •๋ ฌ ๋ฐ ํˆฌ ํฌ์ธํ„ฐ๋ฅผ ์ด์šฉํ•ด ๋ชจ๋“  3์ˆ˜ ํ•ฉ์ด 0์ธ ๊ฒฝ์šฐ๋ฅผ ์ฐพ๊ณ  ์ค‘๋ณต์„ ์ œ๊ฑฐํ•ฉ๋‹ˆ๋‹ค. ํ•ด์‹œ ์…‹์„ ์‚ฌ์šฉํ•ด ์ค‘๋ณต ์ œ๊ฑฐ๋ฅผ ๋‹ฌ์„ฑํ•˜์ง€๋งŒ ์ตœ์•…์˜ ๊ฒฝ์šฐ ์ถ”๊ฐ€ ๊ณต๊ฐ„์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

๊ฐœ์„  ์ œ์•ˆ: ๊ณ ๋ คํ•ด๋ณผ ๋งŒํ•œ ๋Œ€์•ˆ: ์ค‘๋ณต ์ œ๊ฑฐ๋ฅผ Set ๋Œ€์‹  ๋กœ์ง์œผ๋กœ๋งŒ ์ฒ˜๋ฆฌํ•ด ๋ถˆํ•„์š”ํ•œ ํ•ด์‹œ ์‚ฌ์šฉ์„ ์ค„์ด๊ณ , ๊ฒฐ๊ณผ๋ฅผ ์ฆ‰์‹œ ์ค‘๋ณต ์ œ๊ฑฐ๋œ ๋ฆฌ์ŠคํŠธ์— ์ถ”๊ฐ€ํ•˜๋„๋ก ๊ตฌํ˜„ํ•ด๋„ ๋ฉ๋‹ˆ๋‹ค.

๐Ÿ’ก ํ’€์ด์— ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„๋ฅผ ์ฃผ์„์œผ๋กœ ๋‚จ๊ฒจ๋ณด์„ธ์š”!

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.

๐Ÿท๏ธ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ํŒจํ„ด ๋ถ„์„

  • ํŒจํ„ด: Dynamic Programming, Greedy
  • ์„ค๋ช…: ํด๋ผ์ด๋ฐ ์Šคํ… ๋ฌธ์ œ๋Š” ๊ฐ ๋‹จ๊ณ„์˜ ๊ฒฝ์šฐ์˜ ์ˆ˜๋ฅผ ์ด์ „ ๋‘ ๋‹จ๊ณ„์˜ ํ•ฉ์œผ๋กœ ๊ตฌํ•˜๋Š” ํ˜•ํƒœ๋กœ, DP์˜ ์ ํ™”์‹์„ ์ด์šฉํ•œ ์ „ํ˜•์ ์ธ ํ’€์ด์ž…๋‹ˆ๋‹ค. ๊ฐ„๋‹จํ•œ ์ตœ์ ํ™”๋กœ ๋ฐฐ์—ด ์—†์ด ์ƒํƒœ๋งŒ ์œ ์ง€ํ•˜๋Š” ๋ฐฉ์‹๋„ DP์˜ ํ•œ ํ˜•ํƒœ๋กœ ํ•ด์„๋ฉ๋‹ˆ๋‹ค.

๐Ÿ“Š ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„ ๋ถ„์„

๋ณต์žก๋„
Time O(n)
Space O(1)

ํ”ผ๋“œ๋ฐฑ: ์ดˆ๊ธฐ๊ฐ’์„ ์„ค์ •ํ•œ ๋’ค ์ˆœํšŒํ•˜๋ฉด์„œ ํ˜„์žฌ ๊ฒฝ์šฐ์˜ ์ˆ˜๋ฅผ ๊ฐฑ์‹ ํ•ฉ๋‹ˆ๋‹ค. ์ƒ์ˆ˜ ๊ณต๊ฐ„์œผ๋กœ ๊ตฌํ˜„๋ผ ์ถ”๊ฐ€ ๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ์ด ์—†์Šต๋‹ˆ๋‹ค.

๊ฐœ์„  ์ œ์•ˆ: ํ˜„์žฌ ๊ตฌํ˜„์ด ์ ์ ˆํ•ด ๋ณด์ž…๋‹ˆ๋‹ค.

๐Ÿ’ก ํ’€์ด์— ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„๋ฅผ ์ฃผ์„์œผ๋กœ ๋‚จ๊ฒจ๋ณด์„ธ์š”!

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, Sliding Window, Monotonic Stack, Hash Map / Hash Set, Greedy, Divide and Conquer, Dynamic Programming, Binary Search, Union Find, Trie, Bit Manipulation, BFS, DFS, Backtracking, Heap / Priority Queue
  • ์„ค๋ช…: ๋‘ ๋ฐฐ์—ด ํŒจํ„ด ์—†์ด๋„ ์™ผ์ชฝ/์˜ค๋ฅธ์ชฝ ๋ˆ„์  ๊ณฑ์„ ์ด์šฉํ•˜๋Š” ํŒจํ„ด์œผ๋กœ, Right-Left ๋ˆ„์  ๊ณฑ ๋ฐฐ์—ด์„ ๋งŒ๋“ค์–ด ์ •๋‹ต์„ ๊ตฌํ•˜๋Š” ๋ฐฉ์‹์ด๋‹ค. ์ด๋Š” DP์˜ ๋ถ€๋ถ„ ๋ฌธ์ œ ์žฌ์‚ฌ์šฉ๊ณผ ๊ฐ™์€ ๋ˆ„์ ๊ณฑ(์ „๋‹ฌ ๋ณ€์ˆ˜) ํ™œ์šฉ์œผ๋กœ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.

๐Ÿ“Š ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„ ๋ถ„์„

๋ณต์žก๋„
Time O(n)
Space O(n)

ํ”ผ๋“œ๋ฐฑ: ์™ผ์ชฝ ๋ˆ„์ ๊ณฑ๊ณผ ์˜ค๋ฅธ์ชฝ ๋ˆ„์ ๊ณฑ ๋ฐฐ์—ด์„ ๋งŒ๋“ค์–ด ๊ฐ ์ธ๋ฑ์Šค์˜ ๊ฒฐ๊ณผ๋ฅผ ๊ณฑ์œผ๋กœ ๊ตฌํ•ฉ๋‹ˆ๋‹ค. ์ถ”๊ฐ€ ๋ฐฐ์—ด ์‚ฌ์šฉ์œผ๋กœ ๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ์ด ์ฆ๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

๊ฐœ์„  ์ œ์•ˆ: ํ˜„์žฌ ๊ตฌ์กฐ๋„ ์ ์ ˆํ•˜์ง€๋งŒ ๊ณต๊ฐ„ ์ ˆ๊ฐ์„ ์›ํ•˜๋ฉด ๋‘ ๋ฐฐ์—ด ๋Œ€์‹  ํ•˜๋‚˜์˜ ๊ฒฐ๊ณผ ๋ฐฐ์—ด๊ณผ ์ž„์‹œ ๋ณ€์ˆ˜๋กœ ๊ตฌํ˜„ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๊ณ ๋ คํ•ด๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๐Ÿ’ก ํ’€์ด์— ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„๋ฅผ ์ฃผ์„์œผ๋กœ ๋‚จ๊ฒจ๋ณด์„ธ์š”!

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.

๐Ÿท๏ธ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ํŒจํ„ด ๋ถ„์„

  • ํŒจํ„ด: Hash Map / Hash Set, Bit Manipulation
  • ์„ค๋ช…: ๋‘ ๋ฌธ์ž์—ด์˜ ๋ฌธ์ž ๋“ฑ์žฅ ํšŸ์ˆ˜๋ฅผ ๋ฐฐ์—ด๋กœ ์นด์šดํŠธํ•˜์—ฌ ๋น„๊ตํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ํ•ด์‹œ ๋งต/์„ธํŠธ ์—†์ด๋„ ๋“ฑ์žฅ ์—ฌ๋ถ€๋ฅผ ํŒ๋‹จํ•œ๋‹ค. ๋ฐฐ์—ด ์ธ๋ฑ์Šค๋Š” ๋ฌธ์ž ๊ฐ„ ์ฐจ์ด๋กœ ๋งคํ•‘๋˜๋ฉฐ, 26 ์•ŒํŒŒ๋ฒณ ๊ณ ์ • ํฌ๊ธฐ ์นด์šดํŠธ๋ฅผ ์ด์šฉํ•œ ์ฐจ๊ฐ์œผ๋กœ ์ค‘๋ณต ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•œ๋‹ค.

๐Ÿ“Š ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„ ๋ถ„์„

๋ณต์žก๋„
Time O(n)
Space O(1)

ํ”ผ๋“œ๋ฐฑ: ๊ณ ์ • ํฌ๊ธฐ ๋ฐฐ์—ด(26)๋กœ ๋ฌธ์ž ๋นˆ๋„๋ฅผ ๊ณ„์‚ฐํ•˜์—ฌ ๋น„๊ตํ•ฉ๋‹ˆ๋‹ค. ์ž…๋ ฅ ๋ฌธ์ž์—ด์˜ ๊ธธ์ด์— ๋น„๋ก€ํ•˜๋Š” ์‹œ๊ฐ„๊ณผ ์ƒ์ˆ˜ ๊ณต๊ฐ„์„ ๊ฐ€์ง‘๋‹ˆ๋‹ค.

๊ฐœ์„  ์ œ์•ˆ: ํ˜„์žฌ ๊ตฌํ˜„์ด ์ ์ ˆํ•ด ๋ณด์ž…๋‹ˆ๋‹ค.

๐Ÿ’ก ํ’€์ด์— ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„๋ฅผ ์ฃผ์„์œผ๋กœ ๋‚จ๊ฒจ๋ณด์„ธ์š”!

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.

๐Ÿท๏ธ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ํŒจํ„ด ๋ถ„์„

  • ํŒจํ„ด: Binary Search, Depth-First Search, Depth-First Search
  • ์„ค๋ช…: BST ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ์—์„œ ๊ฐ ๋…ธ๋“œ๋ฅผ ๋ฒ”์œ„๋กœ ์ œ์•ฝํ•˜๋ฉฐ ์ขŒ์šฐ ์„œ๋ธŒํŠธ๋ฆฌ์— ์žฌ๊ท€์ ์œผ๋กœ ์กฐ๊ฑด์„ ํ™•์ธํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ๊ตฌํ˜„๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ํŠธ๋ฆฌ๋ฅผ ๊นŠ์ด ์šฐ์„  ํƒ์ƒ‰ํ•˜๋ฉฐ ๊ฐ ๋…ธ๋“œ์˜ ๊ฐ’์ด ํ—ˆ์šฉ๋œ ๋ฒ”์œ„๋ฅผ ๋ฒ—์–ด๋‚˜๋ฉด ๋ถˆ๋ฆฌ์–ธ์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

๐Ÿ“Š ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„ ๋ถ„์„

๋ณต์žก๋„
Time O(n)
Space O(h)

ํ”ผ๋“œ๋ฐฑ: ๊ฐ ๋…ธ๋“œ์— ๋Œ€ํ•ด ์ตœ์†Œ/์ตœ๋Œ€ ์œ ํšจ ๋ฒ”์œ„๋ฅผ ์œ ์ง€ํ•˜๊ณ  ์žฌ๊ท€์ ์œผ๋กœ ๊ฒ€์‚ฌํ•ฉ๋‹ˆ๋‹ค. ์ตœ์•…์˜ ๊ฒฝ์šฐ ํŠธ๋ฆฌ์˜ ๋†’์ด์— ๋”ฐ๋ผ ๊ณต๊ฐ„ ๋ณต์žก๋„๊ฐ€ ์ฆ๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

๊ฐœ์„  ์ œ์•ˆ: ํ˜„์žฌ ๊ตฌํ˜„์ด ์ ์ ˆํ•ด ๋ณด์ž…๋‹ˆ๋‹ค.

๐Ÿ’ก ํ’€์ด์— ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„๋ฅผ ์ฃผ์„์œผ๋กœ ๋‚จ๊ฒจ๋ณด์„ธ์š”!

@JAEKWANG97 JAEKWANG97 merged commit 8a53dae into DaleStudy:main Jul 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants