Skip to content

Conversation

@shining-ai
Copy link
Owner

middle_2 = len(nums2) // 2
if middle_1 + middle_2 < k:
if nums1[middle_1] < nums2[middle_2]:
return get_kth_small(k - middle_1 - 1, nums1[middle_1 + 1 :], nums2)
Copy link

Choose a reason for hiding this comment

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

これはここでスライスを取っているからコピーされていませんか。

Copy link
Owner Author

Choose a reason for hiding this comment

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

level1のようにindexで管理したほうが良さそうですね。
引数減らせて読みやすいかと思いましたが、遅くなるデメリットのほうが大きいですね。

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