08 2023 档案

摘要:``` class Solution { public: int res=0; int lengthOfLongestSubstring(string s) { int n=s.size (); if(!n) return 0; bool st[128]={false}; for(int j=0,i 阅读全文
posted @ 2023-08-05 11:06 穿过雾的阴霾 阅读(6) 评论(0) 推荐(0) 编辑
摘要:``` class Solution { public: vector dailyTemperatures(vector& t) { stack st; int n=t.size(); vector res(n); for(int i=n-1;i>=0;i--) { while(st.size()& 阅读全文
posted @ 2023-08-04 12:14 穿过雾的阴霾 阅读(9) 评论(0) 推荐(0) 编辑
摘要:# 暴力 ``` class Solution { public: int res=0; int countSubstrings(string s) { int n=s.size(); for(int i=0;i=0&&r=0&&r> f(n+1,vector(n+1,false)); for(in 阅读全文
posted @ 2023-08-03 10:55 穿过雾的阴霾 阅读(5) 评论(0) 推荐(0) 编辑
摘要:``` class Solution { public: int findUnsortedSubarray(vector& nums) { int n=nums.size(); int l=0,r=n-1; while(l0&&nums[r]>=nums[r-1]) r--; int min_num 阅读全文
posted @ 2023-08-01 11:03 穿过雾的阴霾 阅读(4) 评论(0) 推荐(0) 编辑
摘要:``` /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), 阅读全文
posted @ 2023-08-01 10:18 穿过雾的阴霾 阅读(8) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示