Single Number
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runti...
分类:
其他好文 时间:
2015-06-23 15:37:31
阅读次数:
124
Valid Sudoku
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.
The Sudoku board could be partially filled, where empty cells are fil...
分类:
其他好文 时间:
2015-06-22 11:13:05
阅读次数:
141
Set Matrix Zeroes
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
Follow up:
Did you use extra space?
A s...
分类:
其他好文 时间:
2015-06-22 11:12:40
阅读次数:
113
Rotate Image
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Follow up:
Could you do this in-place?...
分类:
其他好文 时间:
2015-06-22 11:11:54
阅读次数:
116
Gray Code
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the to...
分类:
其他好文 时间:
2015-06-22 11:11:12
阅读次数:
115
Permutation Sequence
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
The set [1,2,3,…,n] contains a total of n! unique
permutations.
By listing and labeling all of the permutations in order,
We get the f...
分类:
其他好文 时间:
2015-06-21 14:34:43
阅读次数:
136
3Sum Closest
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the thr...
分类:
其他好文 时间:
2015-06-21 13:13:56
阅读次数:
114
4Sum
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d =
target? Find all unique quadruplets in the array whi...
分类:
其他好文 时间:
2015-06-21 13:13:30
阅读次数:
123
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
3Sum
Given an array S of n integers,
are there elements a, b, c in S such
that a + b + c =
0? Find all unique triplets in the array which gives the sum ...
分类:
其他好文 时间:
2015-06-21 13:13:27
阅读次数:
127
Next Permutation
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
If such arrangement is n...
分类:
其他好文 时间:
2015-06-21 13:13:09
阅读次数:
130