摘要:
// Double points, or we can use DP (2 vectors to maintain left-max and right-max of each point.) class Solution { public: int trap(vector& height) { int res = 0, i = 0, j = height.size()-... 阅读全文
posted @ 2018-11-30 16:37
JTechRoad
阅读(91)
评论(0)
推荐(0)
摘要:
class Solution { public: int computeArea(int A, int B, int C, int D, int E, int F, int G, int H) { int res = (C-A) * (D-B) + (G-E) * (H-F); long x1 = max(A,E), y1 = max(B,F), x2 =... 阅读全文
posted @ 2018-11-30 15:44
JTechRoad
阅读(102)
评论(0)
推荐(0)
摘要:
class Solution { public: vector findErrorNums(vector& nums) { for (int i = 0; i ({nums[res], res+1}); } }; 阅读全文
posted @ 2018-11-30 15:16
JTechRoad
阅读(99)
评论(0)
推荐(0)
摘要:
class Solution { public: string reverseStr(string s, int k) { for (size_t i = 0; i < s.length(); i += 2 * k) { int start = i; int end = min(i+k, s.length()) - 1; ... 阅读全文
posted @ 2018-11-30 14:43
JTechRoad
阅读(106)
评论(0)
推荐(0)
浙公网安备 33010602011771号