摘要: 347. Top K Frequent Elements class Solution { public: vector<int> topKFrequent(vector<int>& nums, int k) { // hash map 储存frequency unordered_map<int, 阅读全文
posted @ 2020-09-12 22:00 cancantrbl 阅读(1099) 评论(0) 推荐(0) 编辑
摘要: 704. 二分查找 - Binary Search class Solution { public: int search(vector<int>& nums, int target) { int middle, left = 0; int right = nums.size()-1; while 阅读全文
posted @ 2020-09-12 13:27 cancantrbl 阅读(179) 评论(0) 推荐(0) 编辑