fix 706: bug with edge case

This commit is contained in:
kinsolee
2022-02-08 22:03:54 +08:00
parent 1e0a830c33
commit 09d51fd394
3 changed files with 8 additions and 5 deletions

View File

@ -1,6 +1,6 @@
package leetcode
const Len int = 100000
const Len int = 10000
type MyHashMap struct {
content [Len]*HashNode
@ -41,9 +41,9 @@ func (N *HashNode) Remove(key int) *HashNode {
return p
}
if N.next != nil {
return N.next.Remove(key)
N.next = N.next.Remove(key)
}
return nil
return N
}
/** Initialize your data structure here. */