Home Resume Mood Amusement About
手撸算法终版
2020-11-30 |

1. 两数之和(为目标值) 3min1234567891011121314vector<int> twoSum(vector<int>& nums, int target){ umordered_map<int, int> hashtable; /* xiaoguo */ for(int i = 0; i < nums.size(); i++) { auto it = hashtable.find(target - nums[i]); if(it != hashtable.end()) return {it->second, i}; hashtable[nums[i]] = i; } return {};}

Algorithm | Algorithm

head-sculpture

CHAsencenge

解字

Recent
  • FPS问题解决记录
  • 单例模式
  • 工厂模式
  • 手撸算法终版
  • 哈希专题
  • 特殊技巧专题
  • 栈和队列专题
  • 树专题
Categories
  • Algorithm21
  • Android1
  • DesignPattern2
  • Docker1
  • GameDev4
  • Git1
  • Hexo2
  • Laya4
  • Light Frequency Authenticate1
  • Linux1
  • LoRa1
  • Python4
  • Unity5
    • Unreal1
  • Writing3
  • cpp3
Archives
  • 2021-011
  • 2020-122
  • 2020-111
  • 2020-109
  • 2020-096
  • 2020-086
  • 2020-0721
  • 2019-111
  • 2019-092
  • 2019-076
Tags
Algorithm C++ Docker GameDev Git Gradle Hexo Laya LoRa Python UE Unity Unreal Writing cpp hexo lightFre writing 远程登录
Copyright © 2019 | Powered by Hexo | Theme by Loren | 浙ICP备18016660号-1