LeetCode202 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 inte...

2017-02-20 21:50:48

阅读数:123

评论数:0

LeetCode13 Roman to Integer

题目Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.解题思路罗马数字的规则参考这个。 总结起来就是如果前一位数字大于后一位,就加上其...

2017-02-19 14:55:37

阅读数:137

评论数:0

LeetCode409 Longest Palindrome

题目Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters.Th...

2017-02-16 21:27:26

阅读数:144

评论数:0

LeetCode169 Majority Element

题目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 t...

2017-02-16 19:51:09

阅读数:128

评论数:0

LeetCode242 Valid Anagram

题目Given two strings s and t, write a function to determine if t is an anagram of s.For example, s = “anagram”, t = “nagaram”, return true. s = “rat...

2017-02-16 12:58:49

阅读数:137

评论数:0

LeetCode171 Excel Sheet Column Number

题目Given a column title as appear in an Excel sheet, return its corresponding column number.For example:A -> 1 B -> 2 C -> 3 ... Z -> 26 A...

2017-02-15 21:40:05

阅读数:171

评论数:0

LeetCode387 First Unique Character in a String

题目Given a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, return -1.Examples:s = “leetcode” return ...

2017-02-15 17:19:35

阅读数:139

评论数:0

LeetCode349 Intersection of Two Arrays

原题Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. Note: Each e...

2017-02-14 21:27:36

阅读数:196

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭