未验证 提交 1f650074 编写于 作者: J jbaenaxd 提交者: GitHub

Shortened code (#3855)

上级 a5389899
......@@ -44,8 +44,7 @@ def quick_select(items: list, index: int):
if index >= len(items) or index < 0:
return None
pivot = random.randint(0, len(items) - 1)
pivot = items[pivot]
pivot = items[random.randint(0, len(items) - 1)]
count = 0
smaller, equal, larger = _partition(items, pivot)
count = len(equal)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册