S2 icon indicating copy to clipboard operation
S2 copied to clipboard

0219. Contains Duplicate I I | LeetCode Cookbook

Open halfrost opened this issue 4 years ago • 4 comments

https://books.halfrost.com/leetcode/ChapterFour/0200~0299/0219.Contains-Duplicate-II/

halfrost avatar Feb 26 '21 13:02 halfrost

保证map的大小恒定这一个想法很赞

VictorNanka avatar Oct 11 '21 05:10 VictorNanka

这种思路很好,避免了频繁的计算index的差值,效率快狠毒

vkeeps avatar Feb 12 '22 03:02 vkeeps

厉害!提一个小问题:record的length其实可以初始为 k+1 对吧,因为只需要保证可以检测到额外一个数值即可吧。感谢!

delongGao avatar Oct 18 '22 14:10 delongGao

厉害!提一个小问题:record的length其实可以初始为 k+1 对吧,因为只需要保证可以检测到额外一个数值即可吧。感谢!

@delongGao 嗯。可以的。

halfrost avatar Oct 18 '22 16:10 halfrost