package
0.0.0-20241125063422-a7e1e0bf04b0
Repository: https://github.com/blueblue0102/leetcode-go.git
Documentation: pkg.go.dev
# README
217. Contains Duplicate
https://leetcode.com/problems/contains-duplicate/
使用 hash table 的方式
時間複雜度是 $O(n)$
儘管在 hash table 中進行 insert 和 search 是 constant time,但是需要執行 n 次
空間複雜度是 $O(n)$
因為 key 是數字,數字的範圍無限大
Takeaway
無