最新 最热

Leetcode 165 Compare Version Numbers

Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0. You may assume that...

2018-01-12
1

Leetcode 204 Count Primes

Description: Count the number of prime numbers less than a non-negative number, n. 统计小于n的素数有多少个。 用筛法进行素数打表,边打表边记录个数。class Solution {public: int countP......

2018-01-12
0

Leetcode 202 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, repla...

2018-01-12
0

Leetcode 201 Bitwise AND of Numbers Range

Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive. For example, given the range [5, 7], you...

2018-01-12
0

Leetcode 216. Combination Sum III

Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique ...

2018-01-12
1

Leetcode 268. Missing Number

Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example, Given nums = [0, 1, 3] re...

2018-01-12
1

Leetcode 264. Ugly Number II

Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 6, 8, 9...

2018-01-12
1

Leetcode 263. Ugly Number

Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6,...

2018-01-12
0

Leetcode 279. Perfect Squares

Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. For example, given n = 12, return...

2018-01-12
0

[LeetCode] 40. Combination Sum II

该文是关于LeetCode的40. Combination Sum II问题的一个解决方案。该问题要求给定候选数字集合和目标数字,找到所有不重复的组合,使得它们的和等于目标数字。解决方案使用排序来避免重复组合,并使用递归实现核心算法。...

2018-01-03
1