leetcode929
摘要:package main import ( "fmt" "strings" ) func numUniqueEmails(emails []string) int { var dic map[string]int dic = make(map[string]int) for _, s := range emails { strArr :...
阅读全文
posted @
2018-10-28 21:03
Sempron2800+
阅读(125)
推荐(0)
leetcode31
摘要:补充一个非常复杂,不美观的版本,使用python实现,也可以AC,能写出来我也挺佩服自己的。 这个版本的主要思想就是从后向前找,记录已查找范围的最大值,当查找到一个值a比已查找区域的最大值maxnum要小的时候,就可以进行换位操作了。 但是要确定一个在已查找区域中比a值大的最小的那个值来进行交换。所
阅读全文
posted @
2018-10-23 15:49
Sempron2800+
阅读(228)
推荐(0)
leetcode29
摘要:不使用乘法、除法、求余数,计算两个数字相除。 使用加法和减法运算。 Java实现代码如下: 上述代码用实际的例子进行解释,假设a=10,b=3,主要介绍10~19行的循环体的逻辑。 外部循环1:判断 3 <= 10满足 内部循环1.1:3 + 3 <= 10满足,count = 2,sum = 6
阅读全文
posted @
2018-10-21 21:03
Sempron2800+
阅读(144)
推荐(0)
leetcode166
摘要:public class Solution { public String fractionToDecimal(int numerator, int denominator) { HashMap maps = new HashMap();//store divid number List number = new ArrayList(); ...
阅读全文
posted @
2018-10-21 21:02
Sempron2800+
阅读(128)
推荐(0)
leetcode130
摘要:C++实现,使用BFS: 补充一个python的实现,使用DFS:
阅读全文
posted @
2018-10-21 21:00
Sempron2800+
阅读(163)
推荐(0)
leetcode91
摘要:补充一个python的实现: 参考:https://leetcode.com/problems/decode-ways/discuss/30529/Readable-Python-DP-Solution 本题关键在于第11行到15行之间的逻辑,更新dp[i]的规则。 dp[i]表示,前i个字符(从1
阅读全文
posted @
2018-10-21 20:57
Sempron2800+
阅读(186)
推荐(0)
leetcode127
摘要:数据结构:HashSet<String> wordSet 实用hash存储第三个参数单词字典,加速查找 HashMap<String, Integer> map 存储已经访问过的节点,相当于visited LinkedList<Object> q 主循环判断的Stack 算法流程:q中添加源单词,同
阅读全文
posted @
2018-10-21 20:55
Sempron2800+
阅读(166)
推荐(0)
leetcode179
摘要:先给出一个作弊的程序,注意第2,3行。 不得其法,越做越蒙。 再给一个简短的程序:
阅读全文
posted @
2018-10-21 20:47
Sempron2800+
阅读(146)
推荐(0)
leetcode138
摘要:/** * Definition for singly-linked list with a random pointer. * struct RandomListNode { * int label; * RandomListNode *next, *random; * RandomListNode(int x) : label(x), next(NULL),...
阅读全文
posted @
2018-10-21 20:40
Sempron2800+
阅读(123)
推荐(0)
leetcode54
摘要:补充一个使用dfs思想的python实现代码:
阅读全文
posted @
2018-10-21 20:34
Sempron2800+
阅读(136)
推荐(0)
leetcode134
摘要:补充一个python的实现: 题目确保,如果存在解,是唯一的解,因此程序只需要找出可以完成全程的第一个起点就行。 因为全程的加油数量和耗油数量都是固定的,因此从哪个点计算全程的总的消耗都是一样的。不需要先找到起点,然后再进行计算。 因此可以在一次循环中,完成两种计算:1判断是否可以走完全程(tota
阅读全文
posted @
2018-10-21 20:20
Sempron2800+
阅读(163)
推荐(0)
leetcode210
摘要:补充一个python的实现,使用深度优先遍历,进行拓扑排序:
阅读全文
posted @
2018-10-21 20:14
Sempron2800+
阅读(134)
推荐(0)
leetcode754
摘要:class Solution { public: int reachNumber(int target) { // 理解这题的意思 这题就好做了 // 分析 首先考虑一种比较极端的情况 即一直向正方向移动n步 ,刚好达到target // 那么target的值就等于前n步的和 ,也就是1+2+.....+n = n*(n+1)/2 ...
阅读全文
posted @
2018-10-21 20:08
Sempron2800+
阅读(124)
推荐(0)
leetcode743
摘要:class Solution { public: int networkDelayTime(vector>& times, int N, int K) { vector > graph(N + 1, vector(N + 1, 60001)); vector cost(N + 1); vector visited(N + 1, false)...
阅读全文
posted @
2018-10-21 20:04
Sempron2800+
阅读(119)
推荐(0)
leetcode748
摘要:public class Solution { public string ShortestCompletingWord(string licensePlate, string[] words) { var list = words.OrderBy(x => x.Length); var pattern = ...
阅读全文
posted @
2018-10-21 18:56
Sempron2800+
阅读(110)
推荐(0)
leetcode925
摘要:public class Solution { public bool IsLongPressedName(string name, string typed) { var list1 = new List>(); var list2 = new List>(); int name_...
阅读全文
posted @
2018-10-21 17:36
Sempron2800+
阅读(119)
推荐(0)
leetcode227
摘要:class Solution { public: stack OPD; stack OPR; int calculate(int num1, int num2, char opr){ switch (opr){ case '+':{ return num1 + num2; } ...
阅读全文
posted @
2018-10-19 11:04
Sempron2800+
阅读(121)
推荐(0)
leetcode324
摘要:Java版本:先将数组排序,从中间将排好序的数组分为small部分和large部分。 每次从小区间找一个值插入偶数位,从大区间找一个值插入奇数位。 补充一个python的版本:
阅读全文
posted @
2018-10-18 20:12
Sempron2800+
阅读(146)
推荐(0)
leetcode152
摘要:因为nums可能包含负数,因此之前最小的乘积*当前值,有可能成为最大值;而之前最大的乘积*当前值,有可能成为最小值。 因此,每次计算的时候,把目前的最大乘积和最小乘积都保存下来,用于下一次计算。 补充一个python的实现:
阅读全文
posted @
2018-10-18 19:29
Sempron2800+
阅读(150)
推荐(0)
leetcode15
摘要:使用python实现: 下面补充另一种思路,使用python实现,是根据leetcode167 twonum II的思路来做的,效率比上面的方法要高一些,代码如下:
阅读全文
posted @
2018-10-15 14:55
Sempron2800+
阅读(235)
推荐(0)
leetcode221
摘要:本题是动态规划的题目,vec[i,j]记录的是以matrix[i,j]为右下角的所能构成的正方形区域的边长的最大值。 递推公式,vec[i][j] = 1 + min(min(vec[i-1][j],vec[i][j-1]),vec[i-1][j-1]),计算的是当前单元格的“左”、“上”、“左上”
阅读全文
posted @
2018-10-14 20:06
Sempron2800+
阅读(247)
推荐(0)
leetcode322
摘要:Java实现如下: public class Solution { public int coinChange(int[] coins, int amount) { if (amount == 0) return 0; int[] dp = new int[amount + 1]; dp[0] =
阅读全文
posted @
2018-10-14 20:03
Sempron2800+
阅读(217)
推荐(0)
leetcode921
摘要:public class Solution { public int MinAddToMakeValid(string S) { Stack ST = new Stack(); foreach (var s in S) { if (s.Equals('(...
阅读全文
posted @
2018-10-14 19:54
Sempron2800+
阅读(115)
推荐(0)
leetcode922
摘要:public class Solution { public int[] SortArrayByParityII(int[] A) { var len = A.Length; int[] ODD = new int[len / 2];//奇数1,3,5,7,9 int[] EVEN =...
阅读全文
posted @
2018-10-14 19:43
Sempron2800+
阅读(122)
推荐(0)
leetcode148
摘要:class Solution { public: ListNode* sortList(ListNode* head) { multimap mul; while(head){ mul.insert(make_pair(head->val,head)); head=head->next; } ...
阅读全文
posted @
2018-10-14 00:31
Sempron2800+
阅读(129)
推荐(0)
leetcode416
摘要:补充另一种写法: 参考:https://leetcode.com/problems/partition-equal-subset-sum/discuss/90592/01-knapsack-detailed-explanation 先上一张图:测试数据为nums=[1,3,3,5],判断是否可以分割
阅读全文
posted @
2018-10-14 00:25
Sempron2800+
阅读(191)
推荐(0)
leetcode114
摘要:补充一个DFS遍历,然后倒叙组装成类似链表的解决方案,使用python实现: python的递归实现:
阅读全文
posted @
2018-10-12 18:48
Sempron2800+
阅读(153)
推荐(0)
leetcode309
摘要:使用动态规划,下面的代码可以通过210个测试,最后1个(第211个)会超时。说明思路是正确的,但是其中有一些是无效的计算。 再提供网上AC的参考实现: 再补充一个:
阅读全文
posted @
2018-10-12 16:18
Sempron2800+
阅读(194)
推荐(0)
leetcode64
摘要:补充一个python版本: dp是二维数组,每一个元素表示:从起点[0][0]开始,到当前单元格,最小的路径长度。 由于只能向“右”和“下”移动,而且没有负的权值。 因此, 第一行只能按照从左到右顺序,才能获得最小。 第一列,只能按照从上到下顺序,才能获得最小。 而其他单元格,可能有两种策略: 策略
阅读全文
posted @
2018-10-12 14:25
Sempron2800+
阅读(155)
推荐(0)
leetcode647
摘要:参考另外一个python的实现,解释的比较容易懂,代码思路和上面的是一样的。 定义二维数组,table进行动态规划的记录。table[i][j]表示字符串s中,下标i到下标j之间的字符是否是回文字符,true表示:是回文;false表示:不是回文。 10~12行,第一次循环,将对角线上元素进行标记,
阅读全文
posted @
2018-10-12 14:03
Sempron2800+
阅读(196)
推荐(0)
leetcode394
摘要:class Solution { public: string decodeString(string s) { stack chars; stack nums; string res; int num = 0; for (char c: s) { if (isdig...
阅读全文
posted @
2018-10-12 09:04
Sempron2800+
阅读(149)
推荐(0)
leetcode96
摘要:补充一个python的实现: 这道题的思路是,从1到n,依次选择某节点作为根节点。假设n=2, 1为根节点:比1小的元素有0个,比1大的元素有1个,因此有dp[0]*dp[1] 2为根节点:比2小的元素有1个,比2大的元素有0个,因此有dp[1]*dp[0] 这两种情况之和,即为dp[2]。 再假设
阅读全文
posted @
2018-10-11 19:23
Sempron2800+
阅读(161)
推荐(0)
leetcode814
摘要:class Solution { public: TreeNode* pruneTree(TreeNode* root) { if(root==NULL) { return nullptr; } if(root->left!=NULL) { root->left...
阅读全文
posted @
2018-10-10 14:11
Sempron2800+
阅读(113)
推荐(0)
leetcode738
摘要:public class Solution { public int MonotoneIncreasingDigits(int N) { var num = N.ToString(); var len = num.Length; if (len == 1) { ...
阅读全文
posted @
2018-10-09 20:40
Sempron2800+
阅读(164)
推荐(0)
leetcode763
摘要:本题使用贪心算法思想,这里给出的代码是比较高效的一种解法。
阅读全文
posted @
2018-10-09 12:13
Sempron2800+
阅读(131)
推荐(0)
leetcode861
摘要:public class Solution { public int MatrixScore(int[][] A) { var row = A.GetLength(0); var col = A[0].GetLength(0); //判断最高位是否为1 for ...
阅读全文
posted @
2018-10-09 11:31
Sempron2800+
阅读(133)
推荐(0)
leetcode39
摘要:补充一个python的实现,写的要简单的多了:
阅读全文
posted @
2018-10-08 18:38
Sempron2800+
阅读(146)
推荐(0)
leetcode890
摘要:原来的实现中没有加"|"对code进行分割,这样的代码也可以ac,但是会有隐藏的bug,那就是如下两个串会得到相同的编码: abcdefghijklmn abcdefghijbabbbcbd 两个字符串都会编码为012345678910111213,加了竖线就不会再有这个bug。
阅读全文
posted @
2018-10-08 00:21
Sempron2800+
阅读(152)
推荐(0)
leetcode654
摘要:class Solution { public: TreeNode* constructMaximumBinaryTree(vector& nums) { if (nums.size() == 0) return NULL; else if (nums.size() == 1) ...
阅读全文
posted @
2018-10-07 23:42
Sempron2800+
阅读(106)
推荐(0)
leetcode807
摘要:class Solution { public: int maxIncreaseKeepingSkyline(vector>& grid) { //找出每一行的最大值 const int N = 50; int ROW_HEIGHT[N]; int COL_HEIGHT[N]; int MIX_HEIGHT[...
阅读全文
posted @
2018-10-07 23:29
Sempron2800+
阅读(97)
推荐(0)
leetcode917
摘要:class Solution { public: string reverseOnlyLetters(string S) { int len = S.length(); queue Q; stack ST; vector V; for (int i = 0; i = 97 && c = 65 && c <= ...
阅读全文
posted @
2018-10-07 21:08
Sempron2800+
阅读(119)
推荐(0)
leetcode33
摘要:class Solution { public: int search(vector& nums, int target) { //这个题是给一个排序数组,但是数组里面内容被平行移动了,现在要找到tagert所对应的下标 int len = nums.size(); //特殊情况先考虑掉 if (len == 0) ...
阅读全文
posted @
2018-10-06 16:38
Sempron2800+
阅读(180)
推荐(0)
leetcode236
摘要:补充一个DFS实现,使用先序遍历将每一个路径都记录下来,然后分情况讨论。 补充一个python的实现: LCA让我想起了日月生辉的光辉战斗机。
阅读全文
posted @
2018-10-06 16:34
Sempron2800+
阅读(168)
推荐(0)
leetcode139
摘要:补充一个python的实现: dp是bool类型的一维数组,长度是n+1,每个元素表示:从第一个字符开始,到当前位置的(子)字符串,是否可以由字典中的单词表示。 判断策略是对当前子字符串的一次(逆序)遍历。 遍历过程为:以当前字符为结尾,向前遍历,每次找到一个分割位置j, 将子字符串分为“前部”,“
阅读全文
posted @
2018-10-06 14:46
Sempron2800+
阅读(220)
推荐(0)
leetcode19
摘要:补充一个python的实现: 另一种快慢指针的实现不需要递归: python版本:
阅读全文
posted @
2018-10-06 10:39
Sempron2800+
阅读(236)
推荐(0)
leetcode208
摘要:class TrieNode { public: // Initialize your data structure here. TrieNode() { words=0; prefixs=0; for(int i=0;i<26;i++) edges[i]=NULL; } int words; in
阅读全文
posted @
2018-10-06 09:49
Sempron2800+
阅读(351)
推荐(0)
leetcode207
摘要:拓扑排序问题。 补充一个python的实现: 算法思路:深度优先遍历,判断图中是否有环。 使用两个标记数组: visited=True表示当前“线路”上的节点已经被锁定,如果在线路遍历的过程中遇到已经被锁定的节点,那说明遇到了环。 memo表示备忘录(缓存),默认状态为-1,标记为0表示本节点不存在
阅读全文
posted @
2018-10-06 09:48
Sempron2800+
阅读(183)
推荐(0)
leetcode116
摘要:1 class Solution { 2 public: 3 Node* connect(Node* root) { 4 if (root != NULL) 5 { 6 queue<Node*> Q; 7 root->next = NULL; 8 Q.push(root); 9 while (!Q.
阅读全文
posted @
2018-10-06 08:31
Sempron2800+
阅读(190)
推荐(0)
leetcode105
摘要:这是一道分治的题目,用先序找到根节点,用中序找到其左右子树。 补充一个我认为比较容易理解的版本,使用python 实现:
阅读全文
posted @
2018-10-05 22:04
Sempron2800+
阅读(354)
推荐(0)
leetcode131
摘要:深度优先遍历(DFS),先判断前一个部分是否是回文,如果是,则将其加进集合中,然后继续判断后面的回文串。 在回溯的时候,将之前加入集合的串删除,重新选择回文串。每到达一次叶子节点,得到一组结果。 补充一个python的实现:
阅读全文
posted @
2018-10-05 21:42
Sempron2800+
阅读(131)
推荐(0)
leetcode73
摘要:public class Solution { public void SetZeroes(int[,] matrix) { var row = matrix.GetLength(0); var col = matrix.GetLength(1); var listrow = new ...
阅读全文
posted @
2018-10-05 20:52
Sempron2800+
阅读(143)
推荐(0)
leetcode200
摘要:深度优先搜索,每次遇到1,则岛的数量+1,从这个1开始找到所有相连的1,将其改为0。
阅读全文
posted @
2018-10-05 19:55
Sempron2800+
阅读(229)
推荐(0)
leetcode17
摘要:回溯法,深度优先遍历(DFS) 提供一种更直接的思路: 补充一个python的实现: 思路:回溯法。 回溯函数的参数含义: digits:原字符串,dic:按键字典,temp:字母组合的临时存储,res:最终结果的列表,i:digits的索引。
阅读全文
posted @
2018-10-05 17:48
Sempron2800+
阅读(251)
推荐(0)
leetcode103
摘要:class Solution { public: vector> zigzagLevelOrder(TreeNode* root) { vector> V; if (root != NULL) { int i = 0; queue Q; Q.push(root)...
阅读全文
posted @
2018-10-05 16:51
Sempron2800+
阅读(141)
推荐(0)
leetcode279
摘要:动态规划 补充一个python的实现,在leetcode上会TLE,经查询发现在讨论区中也有其他的人遇到了相同的TLE问题。 应该是对python语言的判断机制有问题,这种“平台语言杀”的问题出现过多次了。 经过修改可以AC了,但是效率是比较低的: 既然python不能用dp方法提交,那就再提供一种
阅读全文
posted @
2018-10-05 16:01
Sempron2800+
阅读(190)
推荐(0)
leetcode11
摘要:public class Solution { //public int MaxArea(int[] height) //{ // var max = 0; // for (int i = 0; i < height.Length; i++) // { // for (int j = 0; j <
阅读全文
posted @
2018-10-04 21:42
Sempron2800+
阅读(168)
推荐(0)
leetcode300
摘要:本题使用回溯法,深度优先搜索。使用隐式条件来进行加速。 补充一个使用动态规划的方法,使用python实现,但是效率不是很高: 思路分析:双层循环,时间复杂度是O(n^2)。 dp[i]表示在nums中,以nums[i]为结尾的自增子序列的长度。 第13行是在外层循环,每次循环结束的时候更新,全局的最
阅读全文
posted @
2018-10-04 19:49
Sempron2800+
阅读(194)
推荐(0)
leetcode240
摘要:public class Solution { public bool SearchMatrix(int[,] matrix, int target) { int i = 0, j = matrix.GetLength(1) - 1; while (i = 0) { ...
阅读全文
posted @
2018-10-04 15:57
Sempron2800+
阅读(112)
推荐(0)
leetcode36
摘要:public class Solution { public bool IsValidSudoku(char[,] board) { for (int i = 0; i (); for (int j = 0; j (); for (int i = 0; i (); ...
阅读全文
posted @
2018-10-04 14:18
Sempron2800+
阅读(109)
推荐(0)
leetcode289
摘要:public class Solution { public void GameOfLife(int[][] board) { var row = board.GetLength(0) - 1; var col = board[0].GetLength(0) - 1; var list...
阅读全文
posted @
2018-10-04 11:44
Sempron2800+
阅读(128)
推荐(0)
leetcode75
摘要:上面这个太弱了,给一个强不了多少的 下面给出一个比较强的 注意swap的写法,如果用temp来存,速度会慢很多。
阅读全文
posted @
2018-10-03 19:45
Sempron2800+
阅读(144)
推荐(0)
leetcode380
摘要:数据结构设计问题,从网上找的参考答案。 根据以上的思路,写了一份python版本的代码:
阅读全文
posted @
2018-10-03 19:37
Sempron2800+
阅读(128)
推荐(0)
leetcode49
摘要:public class Solution { public IList> GroupAnagrams(string[] strs) { var L = new List>(); var T = new List>(); for (var i = 0; i (); ...
阅读全文
posted @
2018-10-03 19:08
Sempron2800+
阅读(155)
推荐(0)
leetcode48
摘要:根据题目寻找规律,使用临时变量记录被替换的数据。
阅读全文
posted @
2018-10-03 15:10
Sempron2800+
阅读(197)
推荐(0)
leetcode62
摘要:使用排列组合计算公式来计算,注意使用long long型数据保证计算不会溢出。 补充一个使用dp的方案,python 实现: 初始化index==0的行和index==0的列,起点为0,其他都是1(黑色)。 然后从(1,1)开始计算,可以一行一行的计算,也可以一列一列的计算,也可以按对角线计算,总之
阅读全文
posted @
2018-10-03 13:33
Sempron2800+
阅读(266)
推荐(0)
leetcode102
摘要:本题是广度优先遍历(BFS)实现树的层次遍历,使用队列实现。 补充一个python的实现:
阅读全文
posted @
2018-10-03 10:03
Sempron2800+
阅读(173)
推荐(0)
leetcode78
摘要:本题是回溯法的基本应用,深度优先遍历,使用递归实现。 补充一个python版本:
阅读全文
posted @
2018-10-03 09:38
Sempron2800+
阅读(211)
推荐(0)
leetcode914
摘要:本周的新题目,也是目前easy中的最后一题,算是一个阶段完成了吧。
阅读全文
posted @
2018-10-01 19:19
Sempron2800+
阅读(176)
推荐(0)
leetcode686
摘要:/* 上来的想法是KMP的思想,但是具体不会KMP的实现,c++STL的string 中的find?但是要注意A的长度与B的长度的问题,首先A的长度要大于B的长度 分为三个阶段: 1. A比B的长度要短,这时A要不断增加。 2. A 比 B 刚好长, 3, A 比 B 刚好长的长度 + 1个A的长度, 这时能够保证在A的原始的串中能够索引完一遍B的长度,如果此时没有找到那么就要返...
阅读全文
posted @
2018-10-01 18:03
Sempron2800+
阅读(86)
推荐(0)
leetcode680
摘要:参考网上的实现,递归解法。 主要思想是:双指针。 判断一个字符串是否是回文,基本的方法是使用双指针。一个从左向右遍历,一个从右向左遍历。 每次遍历进行判断,如果左和右不想等,那么就说明不是回文。 这道题是在判断回文的基础上,可以删除一个字符。 当左和右不想等的时候,有两种可能:左边的是多余字符,右边
阅读全文
posted @
2018-10-01 17:26
Sempron2800+
阅读(135)
推荐(0)
leetcode840
摘要:本题不清楚题意,从网上找到了python的解答,记录如下。
阅读全文
posted @
2018-10-01 16:18
Sempron2800+
阅读(105)
推荐(0)
leetcode703
摘要:class KthLargest { public: KthLargest(int k, vector nums) { size = k; for(auto num:nums){ pq.push(num); if(pq.size() > size) pq.pop(); ...
阅读全文
posted @
2018-10-01 16:10
Sempron2800+
阅读(117)
推荐(0)
leetcode704
摘要:public class Solution { public int Search(int[] nums, int target) { var len = nums.Length; var low = 0; var high = len - 1; if (target == nums[low]) {
阅读全文
posted @
2018-10-01 14:29
Sempron2800+
阅读(111)
推荐(0)
leetcode849
摘要:public class Solution { public int MaxDistToClosest(int[] seats) { int lastST = seats.Length - 1; var len = seats.Length; if (len (); ...
阅读全文
posted @
2018-10-01 13:56
Sempron2800+
阅读(84)
推荐(0)
leetcode707
摘要:数据结构的题,从网上找到的实现方式,先记录下来。
阅读全文
posted @
2018-10-01 12:56
Sempron2800+
阅读(147)
推荐(0)
leetcode705
摘要:class MyHashSet { public: /** Initialize your data structure here. */ MyHashSet() { } void add(int key) { if(set[key] == 0) set[key]++; } ...
阅读全文
posted @
2018-10-01 12:49
Sempron2800+
阅读(135)
推荐(0)
leetcode724
摘要:public class Solution { public int PivotIndex(int[] nums) { if (nums.Length == 0) { return -1; } var left = 0; ...
阅读全文
posted @
2018-10-01 12:21
Sempron2800+
阅读(105)
推荐(0)
leetcode747
摘要:public class Solution { public int DominantIndex(int[] nums) { var list = new List>(); for (int i = 0; i (i, nums[i])); } var olis...
阅读全文
posted @
2018-10-01 11:58
Sempron2800+
阅读(91)
推荐(0)
leetcode720
摘要:public class Solution { public string LongestWord(string[] words) { var maxlist = new List(); var dic = new Dictionary(); Queue Q = new Qu...
阅读全文
posted @
2018-10-01 11:40
Sempron2800+
阅读(119)
推荐(0)
leetcode671
摘要:class Solution { public: vector V; void postTree(TreeNode* node) { if (node != NULL) { V.push_back(node->val); if (node->left != NULL) ...
阅读全文
posted @
2018-10-01 09:48
Sempron2800+
阅读(98)
推荐(0)
leetcode674
摘要:大体思路是正确的,有些细节没有考虑清楚。参考了网上的答案进行了修正。
阅读全文
posted @
2018-10-01 09:32
Sempron2800+
阅读(122)
推荐(0)
leetcode744
摘要:public class Solution { public char NextGreatestLetter(char[] letters, char target) { //a-97 z-122 var dic = new List>(); //key存储当前值,int是下一个值 ...
阅读全文
posted @
2018-10-01 08:36
Sempron2800+
阅读(125)
推荐(0)