摘要:
class Solution { public: int maxArea(vector<int>& height) { int i = 0; int j = height.size()-1; int res = -1; while(i<j){ res = max(res,min(height[j], 阅读全文
posted @ 2021-07-14 19:01
三一一一317
阅读(26)
评论(0)
推荐(0)
摘要:
注意这题求的是子串不是子序列 class Solution { public: string longestPalindrome(string s) { if(s.size()<2) return s; int len = s.length(); int maxlen = 1; int start 阅读全文
posted @ 2021-07-14 17:41
三一一一317
阅读(28)
评论(0)
推荐(0)
摘要:
\ 此题与之前在一个数组中找中位数类似,可以在基础上修改。 不过在入堆的时候需要对两个数组大小元素进行判断,小的入堆。 class Solution { public: double findMedianSortedArrays(vector<int>& nums1, vector<int>& nu 阅读全文
posted @ 2021-07-14 15:28
三一一一317
阅读(53)
评论(0)
推荐(0)

浙公网安备 33010602011771号