Skip to content

142-linked-list-cycle-II#10

Open
05ryt31 wants to merge 2 commits intomainfrom
feat/142
Open

142-linked-list-cycle-II#10
05ryt31 wants to merge 2 commits intomainfrom
feat/142

Conversation

@05ryt31
Copy link
Copy Markdown
Owner

@05ryt31 05ryt31 commented Jan 7, 2026

問題リンク

https://leetcode.com/problems/linked-list-cycle-ii/description/

問題文の概要

Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null.

There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that tail's next pointer is connected to (0-indexed). It is -1 if there is no cycle. Note that pos is not passed as a parameter.

Do not modify the linked list.

次に解く予定の問題

https://leetcode.com/problems/remove-duplicates-from-sorted-list/description/

そもそもListじゃないからIndexをどう追うか?

## step2
自分が書いたコードを貼って解説をGPTにしてもらったところ、問題文の読み間違えに気づいた。
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

このあたりの整え方を見ておいてください。

あ、私のしているコメントを GPT に放り込んでどう思うかなどを聞くのもいいです。
https://docs.google.com/document/d/11HV35ADPo9QxJOpJQ24FcZvtvioli770WWdZZDaLOfg/edit?tab=t.0#heading=h.9kpbwslvv3yv

Copy link
Copy Markdown

@TakayaShirai TakayaShirai left a comment

Choose a reason for hiding this comment

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

一旦自分の中でどうすれば解けるかをまとめてから、それをコードでどう表現するかという流れで問題に取り組むと、最初から動くコードが書けるかなと感じます。

これも読むと参考になると思います!
https://discord.com/channels/1084280443945353267/1246383603122966570/1252209488815984710

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants