Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[radiantchoi] WEEK 09 Solutions#2258

Merged
radiantchoi merged 3 commits intoDaleStudy:mainDaleStudy/leetcode-study:mainfrom
radiantchoi:mainradiantchoi/leetcode-study:mainCopy head branch name to clipboard
Jan 9, 2026
Merged

[radiantchoi] WEEK 09 Solutions#2258
radiantchoi merged 3 commits intoDaleStudy:mainDaleStudy/leetcode-study:mainfrom
radiantchoi:mainradiantchoi/leetcode-study:mainCopy head branch name to clipboard

Conversation

@radiantchoi
Copy link
Contributor

@radiantchoi radiantchoi commented Jan 8, 2026

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

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

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

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

Important

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

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

Copy link
Contributor

@ys-han00 ys-han00 left a comment

Choose a reason for hiding this comment

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

์ด๋ฒˆ ์ฃผ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ํ‘ธ์‹œ๋А๋ผ ์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค! ์˜ฌ๋ ค์ฃผ์‹  ์ฝ”๋“œ ์ž˜ ๋ณด์•˜์Šต๋‹ˆ๋‹ค.

๋Šฆ๊ฒŒ ์Šน์ธ ํ•ด๋“œ๋ ค ์ฃ„์†กํ•ฉ๋‹ˆ๋‹ค ๐Ÿ˜ข

Comment on lines +58 to +79
/*
์‚ฌ์ดํด ์‹œ์ž‘ ์ง€์ ์„ ์ฐพ์œผ์‹œ์˜ค, ๋ผ๋Š” ๋ฌธ์ œ์ผ ๊ฒฝ์šฐ?
entry๋ผ๋Š” ๋ณ„๋„์˜ ํฌ์ธํ„ฐ๋ฅผ ํ•˜๋‚˜ ๋” ๋‘” ๋‹ค์Œ slow์™€ ํ•จ๊ป˜ ํ•œ ์นธ์”ฉ ์ด๋™์‹œํ‚จ๋‹ค.
๋‘ ํฌ์ธํ„ฐ๊ฐ€ ๋งŒ๋‚˜๋Š” ์ง€์ ์ด ์‚ฌ์ดํด ์‹œ์ž‘ ์ง€์ !
์ด๊ฒƒ์ด ๊ฐ€๋Šฅํ•œ ์ด์œ ๋Š”, ์•„๋ž˜์˜ ์ด๋™ ๊ฑฐ๋ฆฌ ๊ณต์‹ ๋•Œ๋ฌธ์— ๊ทธ๋ ‡๋‹ค.

L: ์‚ฌ์ดํด ์ž…๊ตฌ๊นŒ์ง€์˜ ๊ธธ์ด
C: ์‚ฌ์ดํด ๊ธธ์ด
d: ์‚ฌ์ดํด ๋‚ด์—์„œ, ์‚ฌ์ดํด ์ข…๋ฃŒ(==์‹œ์ž‘)๊นŒ์ง€ ๋‚จ์€ ๊ฑฐ๋ฆฌ

fast์˜ ์ด๋™ ๊ฑฐ๋ฆฌ: L + n * C + d
slow์˜ ์ด๋™ ๊ฑฐ๋ฆฌ: L + d

fast์˜ ์ด๋™ ๊ฑฐ๋ฆฌ๋Š” slow์˜ ์ด๋™ ๊ฑฐ๋ฆฌ์˜ 2๋ฐฐ์ด๋ฏ€๋กœ
2 * (L + d) = L + n * C + d

๋”ฐ๋ผ์„œ, L = n * C - d ์ด๋‹ค.
๊ทธ๋ฆฌ๊ณ  L์€ entry ํฌ์ธํ„ฐ๊ฐ€ ์ด๋™ํ•ด์•ผ ํ•˜๋Š” ๊ฑฐ๋ฆฌ์ด๋‹ค.
n * C - d๋Š” ์‚ฌ์ดํด ์•ˆ์—์„œ๋Š” C - d์™€ ๊ฐ™๋‹ค. fast ๋…ธ๋“œ๊ฐ€ n๋ฒˆ ๋Œ์•˜์„ ๋ฟ, ์‚ฌ์ดํด ์•ˆ์ด์—ˆ๊ธฐ ๋•Œ๋ฌธ.
๋”ฐ๋ผ์„œ entry ํฌ์ธํ„ฐ์™€ slow ํฌ์ธํ„ฐ๋ฅผ ๋‹ค์‹œ ํ•œ ์นธ์”ฉ ์ด๋™์‹œํ‚ค๋‹ค ๋ณด๋ฉด, ๋ฐ˜๋“œ์‹œ ๋งŒ๋‚˜๊ฒŒ ๋œ๋‹ค.
์ด ๋งŒ๋‚˜๋Š” ์ง€์ ์ด ์‚ฌ์ดํด ์‹œ์ž‘ ์ง€์ .
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

๋ฌธ์ œ๋ฅผ ํ™•์žฅํ•ด์„œ๋„ ์ƒ๊ฐ ํ•˜์…จ๋„ค์š”!

๋•๋ถ„์—, ์‹œ์ž‘ ์ง€์  ์ฐพ๋Š” ๋ฐฉ๋ฒ• ๋ฐฐ์›Œ๊ฐ€์š” ๐Ÿ‘

Copy link
Contributor Author

Choose a reason for hiding this comment

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

์‚ฌ์‹ค ์ด๋ฒˆ์— Floyd's cycle detection algorithm์ด๋ผ๋Š” ๊ฑธ ์•„์˜ˆ ์ฒ˜์Œ ์ ‘ํ•˜๋‹ค ๋ณด๋‹ˆ, ๊ฒฐ๊ตญ ๋งŒ๋‚˜๋Š” ์ง€์ ์„ ์ฐพ์•„์„œ ์–ด๋””๋‹ค ์“ฐ์ง€? ๋ผ๋Š” ์˜๋ฌธ์ด ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์—ญ์‹œ๋‚˜, ๊ทธ๋Ÿฐ ๋ฌธ์ œ๊ฐ€ ์žˆ๊ธด ํ•˜๋”๋ผ๊ตฌ์š”. ๋„์›€์ด ๋˜์…จ๋‹ค๋‹ˆ ๊ธฐ์ฉ๋‹ˆ๋‹ค.

@radiantchoi radiantchoi merged commit 570e44a into DaleStudy:main Jan 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.