Skip to content

57. Insert Interval - #72

Open
naoto-iwase wants to merge 1 commit into
mainfrom
0057-insert-interval
Open

57. Insert Interval#72
naoto-iwase wants to merge 1 commit into
mainfrom
0057-insert-interval

Conversation

@naoto-iwase

Copy link
Copy Markdown
Owner

def insert(
self, intervals: list[list[int]], newInterval: list[int]
) -> list[list[int]]:
start, end = newInterval

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

listをアンパックしているのでnewIntervalのサイズが2ではない場合にValueErrorになるなと思ったのですが、入力の制約上必ずサイズが2になるので大丈夫か、などと思いました。

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