- 博客(7)
- 资源 (1)
- 收藏
- 关注
原创 ***Leetcode 376. Wiggle Subsequence
https://leetcode.com/problems/wiggle-subsequence/description/ class Solution {public: vector<int> filter(vector<int>& nums) { vector<int> ret; for ...
2018-09-29 01:29:34 133
原创 ***Leetcode 692. Top K Frequent Words
https://leetcode.com/problems/top-k-frequent-words/description/用于练习优先队列了。。实际排序也行struct cmp { bool operator() (const auto& a, const auto&b) { if (a.second != b.second) return a.se...
2018-09-19 19:28:53 161
原创 ***Leetcode 297. Serialize and Deserialize Binary Tree
https://leetcode.com/problems/serialize-and-deserialize-binary-tree/description//** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode...
2018-09-17 01:15:51 166
原创 ***Leetcode 174. Dungeon Game
https://leetcode.com/problems/dungeon-game/description/ 以前觉得逆推和正推一样,现在知道逆推在这种情况下还是理解上更容易。另外初始化注意。。 class Solution {public: int calculateMinimumHP(vector<vector<int>>& m...
2018-09-16 03:30:59 115
原创 ***Leetcode 632. Smallest Range
https://leetcode.com/problems/smallest-range/description/ 不错的题 貌似有人头条被问过class cmp { public: bool operator()(const pair<int, int>& n1, const pair<int, int>& n2) const { ...
2018-09-15 21:45:27 206
原创 **Leetcode 168. Excel Sheet Column Title
https://leetcode.com/problems/excel-sheet-column-title/description/这题因为起始是1,所以带来了一些诡异的事情把。。class Solution {public: string cv(int n) { string ret = ""; if (n < 26) {...
2018-09-12 16:32:42 94
原创 **Leetcode 151. Reverse Words in a String
https://leetcode.com/problems/reverse-words-in-a-string/description/各种非法输入很多的题了人生第一次面试是大四腾讯实习生面试,然后但是啥都不会,面试的算法题就是这个,当时现场想的。如今已经2年多过去了,国内已经面完了,T的面试结果这周出...感慨万千...void reverse(char *s, int s...
2018-09-10 16:25:16 99
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人