03 2023 档案
摘要:双指针法,结果只能从最左边或者最右边或者最左边加上最右边中取 class Solution { public: int findLengthOfShortestSubarray(vector<int>& arr) { int n = arr.size(),res = 1,res2 = 1,res3
阅读全文
摘要:静态链表 class Solution { public: int countStudents(vector<int>& students, vector<int>& sandwiches) { int stup = 0,sanp = 0,tmp; int n = students.size(),c
阅读全文
摘要:mysql的大小写转换,字符串连接函数 upper,lower,concat
阅读全文
摘要:注意map的按键和按值排序,按值排序需要转为vector #include<iostream> #include<map> #include<vector> #include<algorithm> using namespace std; int cmp(const pair<int,int>c1,
阅读全文
摘要:memset在填充的时候保证每个字节值相同 https://www.bbsmax.com/A/QV5Z8QEZzy/
阅读全文
摘要:注意整行输入的格式 #include<iostream> #include<sstream> using namespace std; string reorderSpaces(string text) { string words[55]; int n = text.size(),cntWords
阅读全文
摘要:记得用sum,否则多条数据会冲突 # Write your MySQL query statement below select id, sum(case when month='Jan' then revenue else null end) Jan_Revenue, sum(case when
阅读全文