Skip to content

Minimum Time Difference - #160

Open
tom4649 wants to merge 2 commits into
mainfrom
539.Minimum-Time-Difference
Open

Minimum Time Difference#160
tom4649 wants to merge 2 commits into
mainfrom
539.Minimum-Time-Difference

Conversation

@tom4649

@tom4649 tom4649 commented Aug 16, 2026

Copy link
Copy Markdown
Owner


https://leetcode.com/problems/minimum-time-difference/editorial/?envType=problem-list-v2&envId=7p55wqm

バケットソート。全く思いつかなかった。ソート対象の値が限られているときにバケットソートが使えることを覚えておきたい。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Python だと書きにくいですが、木構造も一つで C++ の lower_bound upper_bound もありかと思いました。
Python なら sortedcontainers ですかね。

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

この管理方法はストリーミング処理に適していそうですね。
sortedcontainers 知らなかったので勉強になりました。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

バケットソートも、木構造の分岐が一段で大きさが固定なものという感じなので、そんなに距離はないですね。

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

なるほど、バケットソートが一段の木構造という視点はありませんでした。

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.

2 participants