- 博客(7)
- 资源 (3)
- 收藏
- 关注
原创 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 replac
2015-05-22 21:18:35 269
原创 LeetCode | Number of 1 Bits
题目 Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, the 32-bit integer ’11' has binary representat
2015-05-21 16:40:44 271
原创 LeetCode | House Robber
题目 You 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 adjace
2015-05-21 14:19:56 246
原创 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 t
2015-05-21 10:04:55 372
原创 LeetCode | Length of Last Word
题目 Given 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
2015-05-21 09:04:26 170
原创 LeetCode | Count Primes
题目 Description: Count the number of prime numbers less than a non-negative number, n 分析和思路 题目分为两个部分: 1)素数的判断; 2)找出所有小于n的素数。 素数的判断比较容易,而n以内素数的筛选用到了Sieve of Eratosthenes OK,代码如下:
2015-05-21 08:59:02 245
原创 LeetCode | Valid Palindrome
题目 Given 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" i
2015-05-21 08:48:46 297
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人