Leetcode刷题之路
一天一道力扣
这个作者很懒,什么都没留下…
展开
-
Leetcode.problem2:Add Two Numbers
Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1]. code: public ListNode AddTwoNumbers(ListNode l1, ListNode l2){ ListNode newNode = l2; ...原创 2018-08-10 19:47:15 · 119 阅读 · 0 评论 -
Leetcode.problem1:Two Sum
Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1]. codepublic int[] TwoSum(int[] nums, int target) { List<int> indexList = new L...原创 2018-08-10 20:00:57 · 97 阅读 · 0 评论 -
LeetCode.872: Leaf-Similar Trees
Two binary trees are considered leaf-similar if their leaf value sequence is the same.Return true if and only if the two given trees with head nodes root1 and root2 are leaf-similar. answer:p...原创 2018-09-13 21:31:14 · 108 阅读 · 0 评论 -
LeetCode.7: Reverse Integer
my answer in CSharp codes:public int Reverse(int x) { string value = x.ToString(); string a = ""; if (value.ElementAt(0).Equals('-')) { ...原创 2018-09-13 22:37:31 · 130 阅读 · 0 评论 -
LeetCode.104. Maximum Depth of Binary Tree
public class Solution { private void TraverseNode(TreeNode node) { if (node == null) { return; } if (node.val > max_dept...原创 2018-09-14 08:47:33 · 108 阅读 · 0 评论 -
LeetCode.950
public class Solution { public bool HasGroupsSizeX(int[] deck) { Dictionary<int, int> dic = new Dictionary<int, int>(); bool[] visit = new bool...原创 2018-09-30 17:47:28 · 280 阅读 · 0 评论