摘要: /** * Definition for a binary tree node. * public class TreeNode { * public int val; * public TreeNode left; * public TreeNode right; * public TreeNod 阅读全文
posted @ 2017-04-22 17:56 Sempron2800+ 阅读(117) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public string CountAndSay(int n) { //1 //11 //21 //1211 //111221 //312211 //13112221 //1113213211 if (n == 1) { return "1"; } 阅读全文
posted @ 2017-04-22 17:49 Sempron2800+ 阅读(121) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/guess-number-higher-or-lower/#/description 阅读全文
posted @ 2017-04-22 16:35 Sempron2800+ 阅读(81) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public bool IsPalindrome(int x) { if (x < 0) { return false; } var str = x.ToString(); var list = new List<string>(); foreach 阅读全文
posted @ 2017-04-22 16:01 Sempron2800+ 阅读(103) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int TrailingZeroes(int n) { if (n == 0) { return 0; } else { var x = n / 5; var y = TrailingZeroes(x); return x + y; } 阅读全文
posted @ 2017-04-22 10:45 Sempron2800+ 阅读(92) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int RemoveDuplicates(int[] nums) { var len = nums.Length; if (len == 0) { return 0; } else { var pre = nums[0]; var dif 阅读全文
posted @ 2017-04-22 10:26 Sempron2800+ 阅读(124) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/linked-list-cycle/#/description 补充一个python的版本: 阅读全文
posted @ 2017-04-22 10:11 Sempron2800+ 阅读(137) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/implement-queue-using-stacks/#/description 阅读全文
posted @ 2017-04-22 09:55 Sempron2800+ 阅读(103) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public IList<int> GetRow(int rowIndex) { List<List<int>> list = new List<List<int>>(); for (int i = 0; i <= rowIndex; i++) { v 阅读全文
posted @ 2017-04-22 08:41 Sempron2800+ 阅读(106) 评论(0) 推荐(0) 编辑