Skip to content

Commit d9e3485

Browse files
authored
docs: add a description of the solution to lc problem: No.1748 (doocs#702)
No.1748.Sum of Unique Elements
1 parent 6a0e6ec commit d9e3485

File tree

1 file changed

+6
-3
lines changed
  • solution/1700-1799/1748.Sum of Unique Elements

1 file changed

+6
-3
lines changed

solution/1700-1799/1748.Sum of Unique Elements/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@
4646

4747
<!-- 这里可写通用的实现逻辑 -->
4848

49-
定义一个计数器 counter,存放数组每个元素出现的次数。
50-
51-
然后遍历 counter 中每个元素,累加次数为 1 的所有下标即可。
49+
- 计数
50+
- 定义一个计数器 counter,存放数组每个元素出现的次数。
51+
- 然后遍历 counter 中每个元素,累加次数为 1 的所有下标即可。
52+
- 哈希表
53+
- 遍历 `nums`,累加元素,并使用哈希表记录数字出现的次数。
54+
- 当数字二次出现时,从累加中删减,二次以上则无视。
5255

5356
<!-- tabs:start -->
5457

0 commit comments

Comments
 (0)