1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/唯一元素的和 [sum-of-unique-elements].html
2022-03-29 12:43:11 +08:00

36 lines
870 B
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给你一个整数数组 <code>nums</code> 。数组中唯一元素是那些只出现 <strong>恰好一次</strong> 的元素。</p>
<p>请你返回 <code>nums</code> 中唯一元素的 <strong></strong> 。</p>
<p> </p>
<p><strong>示例 1</strong></p>
<pre><b>输入:</b>nums = [1,2,3,2]
<b>输出:</b>4
<b>解释:</b>唯一元素为 [1,3] ,和为 4 。
</pre>
<p><strong>示例 2</strong></p>
<pre><b>输入:</b>nums = [1,1,1,1,1]
<b>输出:</b>0
<b>解释:</b>没有唯一元素,和为 0 。
</pre>
<p><strong>示例 3 </strong></p>
<pre><b>输入:</b>nums = [1,2,3,4,5]
<b>输出:</b>15
<b>解释:</b>唯一元素为 [1,2,3,4,5] ,和为 15 。
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= nums.length &lt;= 100</code></li>
<li><code>1 &lt;= nums[i] &lt;= 100</code></li>
</ul>