LeetCode Contains Duplicate DescriptionGiven 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 6月 25 2015 #leetcode
LeetCode Length Of Last Word DescriptionGiven a string s consists of upper/lower-case alphabets and empty space characters ‘ ‘, return the length of last word in the string. If the last word does not exist, return 0. Note: A word 6月 25 2015 #leetcode
LeetCode Happy Number DescriptionWrite 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 6月 25 2015 #leetcode
LeetCode Valid Palindrome DescriptionGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,“A man, a plan, a canal: Panama” is a palindrome.“race a car” is no 6月 25 2015 #leetcode
LeetCode House Robber DescriptionYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adj 6月 25 2015 #leetcode
LeetCode Majority Element DescriptionGiven 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 majority el 6月 25 2015 #leetcode
LeetCode Merge Two Sorted Lists DescriptionMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. The original problem is here. The original code 6月 25 2015 #leetcode
LeetCode Valid Parentheses DescriptionGiven a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input string is valid. The brackets must close in the correct order, “()” and “()[]{}” are al 6月 24 2015 #leetcode
LeetCode Container With Most Water DescriptionGiven an array of integers, every element appears three times except for one. Find that single one. Note:Your algorithm should have a linear runtime complexity. Could you implement it witho 6月 24 2015 #leetcode
LeetCode Single Number2 DescriptionGiven an array of integers, every element appears three times except for one. Find that single one. Note:Your algorithm should have a linear runtime complexity. Could you implement it witho 6月 24 2015 #leetcode