摘要:
class Solution { public: int findUnsortedSubarray(vector<int>& nums) { // 笨方法,先排序,再从两端进行比较 int i = 0; int j = nums.size()-1; vector<int> res(nums.size 阅读全文
posted @ 2021-07-25 12:52
三一一一317
阅读(57)
评论(0)
推荐(0)
摘要:
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), rig 阅读全文
posted @ 2021-07-25 11:55
三一一一317
阅读(20)
评论(0)
推荐(0)
摘要:
class Solution { public: int countSubstrings(string s) { // 中心扩展法 // 注意回文中心可能是一个,也可能是两个 // 如果aba 有中心a向两边扩展, abba右bb向两边分别扩展得到。 int res = 0; for(int i = 阅读全文
posted @ 2021-07-25 11:30
三一一一317
阅读(27)
评论(0)
推荐(0)
摘要:
// class Solution { // public: // vector<int> dailyTemperatures(vector<int>& temperatures) { // vector<int> dp(temperatures.size(), 0); // // 这个是求最长子序 阅读全文
posted @ 2021-07-25 11:09
三一一一317
阅读(27)
评论(0)
推荐(0)