随笔分类 -  leetcode

LEETCODE 198. House Robber
摘要:```c++ class Solution { public: int rob(vector& nums) { int len = nums.size(); if(!len) return 0; if(len == 1) return nums[0]; std::vector mem(len,0); 阅读全文

posted @ 2019-04-18 14:52 庭中核桃树 阅读(104) 评论(0) 推荐(0) 编辑

leetcode 174
摘要:```c++ / @lc app=leetcode id=174 lang=cpp [174] Dungeon Game https://leetcode.com/problems/dungeon game/description/ algorithms Hard (26.59%) Total Ac 阅读全文

posted @ 2019-04-18 13:28 庭中核桃树 阅读(206) 评论(0) 推荐(0) 编辑

leetcode 300
摘要:"原题链接" 讨论区的人才有更好的解决方案,利用 STL 的 lower_bound 函数,效率提升不少。 阅读全文

posted @ 2019-03-30 13:16 庭中核桃树 阅读(88) 评论(0) 推荐(0) 编辑

LeetCode 62
摘要:```c++ / @lc app=leetcode id=62 lang=cpp [62] Unique Paths https://leetcode.com/problems/unique paths/description/ algorithms Medium (46.62%) Total Ac 阅读全文

posted @ 2019-03-27 14:09 庭中核桃树 阅读(84) 评论(0) 推荐(0) 编辑

LeetCode 122
摘要:只要上涨就加上。 阅读全文

posted @ 2019-03-27 11:11 庭中核桃树 阅读(119) 评论(0) 推荐(0) 编辑

LeetCode 121
摘要:```c++ class Solution { public: int maxProfit(vector& prices) { if(prices == nullptr || prices.size() max_profit) max_profit = prices[j] prices[i]; } 阅读全文

posted @ 2019-03-27 11:00 庭中核桃树 阅读(111) 评论(0) 推荐(0) 编辑

LeetCode 17 Letter Combinations of a Phone Number
摘要:```C++ / @lc app=leetcode id=17 lang=cpp [17] Letter Combinations of a Phone Number https://leetcode.com/problems/letter combinations of a phone numbe 阅读全文

posted @ 2019-03-26 10:59 庭中核桃树 阅读(113) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

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