### LeetCode算法题

LeetCode难题解题思路解析

0 已关注
22篇博文
• #### 638. Shopping Offers [LeetCode]

In LeetCode Store, there are some kinds of items to sell. Each item has a price. However, there a...

2017-07-18 20:00
2209
• #### 461. Hamming Distance [LeetCode]

The hamming distance between two integers is the number of positions at which the corresponding bits...

2017-01-30 23:02
241
• #### 476. Number Complement [LeetCode]

iven a positive integer, output its complement number. The complement strategy is to flip the bits o...

2017-01-31 17:25
276
• #### 412. Fizz Buzz [LeetCode]

Write a program that outputs the string representation of numbers from 1 to n. But for multiples ...

2017-02-01 17:46
487
• #### 485. Max Consecutive Ones [LeetCode]

Given a binary array, find the maximum number of consecutive 1s in this array. Example 1:  Input...

2017-02-02 00:14
171
• #### 463. Island Perimeter [LeetCode]

You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represen...

2017-02-02 11:12
298
• #### 492. Construct the Rectangle [LeetCode]

题目： For a web developer, it is very important to know how to design a web page's size. So, given ...

2017-02-02 14:50
227
• #### 448. Find All Numbers Disappeared in an Array

Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and ot...

2017-02-02 15:21
593
• #### 226. Invert Binary Tree [LeetCode]

Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 ...

2017-02-02 21:49
421
• #### 167. Two Sum II - Input array is sorted [LeetCode]

Given an array of integers that is already sorted in ascending order, find two numbers such that the...

2017-02-02 22:16
266
• #### 283. Move Zeroes [LeetCode]

Given an array nums, write a function to move all 0's to the end of it while maintaining the relat...

2017-02-02 22:46
121
• #### 455. Assign Cookies [LeetCode]

Assume you are an awesome parent and want to give your children some cookies. But, you should give e...

2017-02-02 23:07
215
• #### 453. Minimum Moves to Equal Array Elements [LeetCode]

Given a non-empty integer array of size n, find the minimum number of moves required to make all arr...

2017-02-03 09:41
126
• #### 383. Ransom Note [LeetCode]

Given an arbitrary ransom note string and another string containing letters from all the magazines, ...

2017-02-03 10:19
192
• #### 404. Sum of Left Leaves [LeetCode]

Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ ...

2017-02-03 11:11
113
• #### 349. Intersection of Two Arrays [LeetCode]

Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, ...

2017-02-03 13:02
110
• #### 122. Best Time to Buy and Sell Stock II [LeetCode]

Say you have an array for which the ith element is the price of a given stock on day i. Design an...

2017-02-03 15:42
188
• #### 387. First Unique Character in a String [LeetCode]

Given a string, find the first non-repeating character in it and return it's index. If it doesn't ex...

2017-02-04 11:26
138
• #### 一次搞懂全排列——LeetCode四道Permutations问题详解

LeetCode中与Permutations相关的共有四题：   31. Next Permutation   46. Permutations   47. Permutations II  ...

2017-03-26 17:52
5526
• #### 34. Search for a Range [LeetCode]

Given an array of integers sorted in ascending order, find the starting and ending position of a giv...

2017-05-08 17:53
180