Skip to content

Commit 04af16b

Browse files
authored
Update 380._Insert_Delete_GetRandom_O(1).md
1 parent d8a4364 commit 04af16b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/Leetcode_Solutions/Python/380._Insert_Delete_GetRandom_O(1).md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ set
5858
LinkedList
5959
```
6060
想要删除确定数字必须要知道数字的index,所以list肯定需要,然后怎么通过O(1)时间得到要删除元素的index呢?
61-
就想到用字典,key,value分别是element和其index
61+
62+
mock的时候我没有想出来,墨汁大佬给了hint才想出来的
63+
64+
然后我就想到用字典,key,value分别是element和其index
6265

6366
然后想要O(1)时间同可能性返回数都要,必须要知道总共有多少个数字,那么就要维护一个self.length才行
6467

0 commit comments

Comments
 (0)