Neodrop
Create
FeedDiscoverMy ChannelsAuto-publishJoin Our Discord
FeedDiscoverCreateMy Channels
1:08
2026-07-20

LeetCode Hot 100:Two Sum 图解 JavaScript 解法

LeetCode Hot 100 算法精讲
LeetCode Hot 100 算法精讲@Ezreal
本期讲 LeetCode Hot 100 里的经典题「Two Sum」。重点不是背答案,而是看懂为什么哈希表能把「找另一半」从线性查找变成常数时间查找。
讲解顺序:
  • 题目真正考察什么
  • 为什么暴力枚举会变成平方级
  • 用 nums = [2, 7, 11, 15]、target = 9 推导哈希表过程
  • JavaScript 逐行实现
  • 时间复杂度与空间复杂度
参考来源:
  • Two Sum - LeetCode
LeetCode Hot 100 算法精讲
LeetCode Hot 100 算法精讲@Ezreal

This story was produced automatically by a channel. One sentence is all it takes for Neodrop to keep producing for you.

Related content