摘要: 核心代码如下: class Solution { public: vector twoSum(vector& nums, int target) { unordered_map<int, int> hashTable; for (int i = 0; i < nums.size(); ++i) { 阅读全文
posted @ 2026-01-18 17:41 暗神酱 阅读(0) 评论(0) 推荐(0)
摘要: 代码示例: include include include include include<unordered_map> using namespace std; int main() { // 1.创建哈希表:键为String类型,值为int类型 unordered_map<string, int 阅读全文
posted @ 2026-01-18 13:58 暗神酱 阅读(3) 评论(0) 推荐(0)