
Hash
文章平均质量分 77
ljffdream
这个作者很懒,什么都没留下…
展开
-
【LeetCode】Single Number
【题目】Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without u原创 2014-12-04 10:22:37 · 313 阅读 · 0 评论 -
【leetcode】Count Primes
【题目】Description:Count the number of prime numbers less than a non-negative number, n.Credits:Special thanks to @mithmatt for adding this problem and creating all test cases.Hint:Let's转载 2015-07-21 09:29:39 · 308 阅读 · 0 评论 -
【Leetcode】Lowest common treenode in binary tree
【题目】Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between tw转载 2015-07-28 22:41:59 · 491 阅读 · 0 评论 -
[Leetcode]Happy Number
[题目]Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the s转载 2015-07-01 13:29:44 · 318 阅读 · 0 评论 -
【Leetcode】Isomorphic Strings
【题目】Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occurrences of a character must be replaced转载 2015-06-29 23:11:27 · 309 阅读 · 0 评论 -
【Leetcode】Contains Duplicate 1 and 2
【题目】Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every el原创 2015-06-20 20:50:11 · 273 阅读 · 0 评论 -
【Leetcode】Intersection of Two Linked List
【题目】:Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a1 → a2 ↘原创 2015-03-30 13:18:51 · 366 阅读 · 0 评论 -
【Leetcode】 Intersection of two linked list
Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a1 → a2 ↘原创 2015-03-30 13:48:16 · 414 阅读 · 0 评论 -
【LeetCode】Majority Numbers
【题目】Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majorit原创 2014-12-24 10:22:30 · 316 阅读 · 0 评论 -
【Leetcode】Construct binary tree from inorder and postorder traversal
【题目】Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.【思路】pretty similar with that转载 2015-09-03 03:10:58 · 411 阅读 · 0 评论