![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
关关雎鸠、
专注收藏博文二十年
展开
-
【leetcode】Longest Substring Without Repeating Characters
核心就是利用map存储字符的数组下标class Solution {public: int lengthOfLongestSubstring(string s) { int res=0,index=0; unordered_map<char,int> m; for(int i=0;i<s.size();i++){ ...原创 2019-06-25 13:13:01 · 173 阅读 · 0 评论 -
【Leetcode】1,Two sum
leetcode上面最简单的一道题。用c++实现,暴力解法。时间复杂度是O(n2)O(n^2)O(n2)class Solution {public: vector<int> twoSum(vector<int>& nums, int target) { vector<int> result; for(int...原创 2019-06-23 15:46:57 · 103 阅读 · 0 评论