mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-12 19:01:47 +08:00
批量更新数据
This commit is contained in:
@@ -13,48 +13,35 @@
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
<p><strong class="example">示例 1:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>votes = ["ABC","ACB","ABC","ACB","ACB"]
|
||||
<strong>输出:</strong>"ACB"
|
||||
<strong>解释:</strong>A 队获得五票「排位第一」,没有其他队获得「排位第一」,所以 A 队排名第一。
|
||||
<pre>
|
||||
<strong>输入:</strong>votes = ["ABC","ACB","ABC","ACB","ACB"]
|
||||
<strong>输出:</strong>"ACB"
|
||||
<strong>解释:</strong>
|
||||
A 队获得五票「排位第一」,没有其他队获得「排位第一」,所以 A 队排名第一。
|
||||
B 队获得两票「排位第二」,三票「排位第三」。
|
||||
C 队获得三票「排位第二」,两票「排位第三」。
|
||||
由于 C 队「排位第二」的票数较多,所以 C 队排第二,B 队排第三。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
<p><strong class="example">示例 2:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>votes = ["WXYZ","XYZW"]
|
||||
<strong>输出:</strong>"XWYZ"
|
||||
<strong>解释:</strong>X 队在并列僵局打破后成为排名第一的团队。X 队和 W 队的「排位第一」票数一样,但是 X 队有一票「排位第二」,而 W 没有获得「排位第二」。
|
||||
<pre>
|
||||
<strong>输入:</strong>votes = ["WXYZ","XYZW"]
|
||||
<strong>输出:</strong>"XWYZ"
|
||||
<strong>解释:</strong>
|
||||
X 队在并列僵局打破后成为排名第一的团队。X 队和 W 队的「排位第一」票数一样,但是 X 队有一票「排位第二」,而 W 没有获得「排位第二」。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 3:</strong></p>
|
||||
<p><strong class="example">示例 3:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>votes = ["ZMNAGUEDSJYLBOPHRQICWFXTVK"]
|
||||
<strong>输出:</strong>"ZMNAGUEDSJYLBOPHRQICWFXTVK"
|
||||
<pre>
|
||||
<strong>输入:</strong>votes = ["ZMNAGUEDSJYLBOPHRQICWFXTVK"]
|
||||
<strong>输出:</strong>"ZMNAGUEDSJYLBOPHRQICWFXTVK"
|
||||
<strong>解释:</strong>只有一个投票者,所以排名完全按照他的意愿。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 4:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>votes = ["BCA","CAB","CBA","ABC","ACB","BAC"]
|
||||
<strong>输出:</strong>"ABC"
|
||||
<strong>解释:</strong>
|
||||
A 队获得两票「排位第一」,两票「排位第二」,两票「排位第三」。
|
||||
B 队获得两票「排位第一」,两票「排位第二」,两票「排位第三」。
|
||||
C 队获得两票「排位第一」,两票「排位第二」,两票「排位第三」。
|
||||
完全并列,所以我们需要按照字母升序排名。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 5:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>votes = ["M","M","M","M"]
|
||||
<strong>输出:</strong>"M"
|
||||
<strong>解释:</strong>只有 M 队参赛,所以它排名第一。
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
Reference in New Issue
Block a user