1 Star 0 Fork 18

zcc/力扣题库(完整版)

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
biggest-single-number.html 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
小墨 提交于 2023-12-09 18:53 +08:00 . update
<p>Table: <code>MyNumbers</code></p>
<pre>
+-------------+------+
| Column Name | Type |
+-------------+------+
| num | int |
+-------------+------+
This table may contain duplicates (In other words, there is no primary key for this table in SQL).
Each row of this table contains an integer.
</pre>
<p>&nbsp;</p>
<p>A <strong>single number</strong> is a number that appeared only once in the <code>MyNumbers</code> table.</p>
<p>Find the largest <strong>single number</strong>. If there is no <strong>single number</strong>, report <code>null</code>.</p>
<p>The result format is in the following example.</p>
<ptable> </ptable>
<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>
<pre>
<strong>Input:</strong>
MyNumbers table:
+-----+
| num |
+-----+
| 8 |
| 8 |
| 3 |
| 3 |
| 1 |
| 4 |
| 5 |
| 6 |
+-----+
<strong>Output:</strong>
+-----+
| num |
+-----+
| 6 |
+-----+
<strong>Explanation:</strong> The single numbers are 1, 4, 5, and 6.
Since 6 is the largest single number, we return it.
</pre>
<p><strong class="example">Example 2:</strong></p>
<pre>
<strong>Input:</strong>
MyNumbers table:
+-----+
| num |
+-----+
| 8 |
| 8 |
| 7 |
| 7 |
| 3 |
| 3 |
| 3 |
+-----+
<strong>Output:</strong>
+------+
| num |
+------+
| null |
+------+
<strong>Explanation:</strong> There are no single numbers in the input table so we return null.
</pre>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tutuzhang0/leetcode-problemset.git
git@gitee.com:tutuzhang0/leetcode-problemset.git
tutuzhang0
leetcode-problemset
力扣题库(完整版)
master

搜索帮助