过去会遗忘,现在不会

2023年6月21日

无重复最长字串

摘要: 滑动窗口类型的, class Solution { public: int lengthOfLongestSubstring(string s) { int l=0;int r=0;int length=0; string ans; while(r<s.size()) { if(ans.find(s 阅读全文

posted @ 2023-06-21 04:01 WhatAnyWay 阅读(13) 评论(0) 推荐(0)
斐波那契数列

摘要: 动态规划入门,复习一下。 正序计算。 class Solution { public: int fib(int n) { unordered_map<int,int> map; map.emplace(0,0); map.emplace(1,1); map.emplace(2,1); if (n<3 阅读全文

posted @ 2023-06-21 03:18 WhatAnyWay 阅读(20) 评论(0) 推荐(0)