Then-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return all distinc...
分类:
其他好文 时间:
2015-07-12 16:58:46
阅读次数:
142
public class Solution { public double myPow(double x, int n) { //利用二分法,通过递归加速计算 //注意:1.判断n是否为负 // 2.递归结束条件,n==1和n==0 //...
分类:
其他好文 时间:
2015-07-12 15:29:10
阅读次数:
110
Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.public class Solution { public Lis...
分类:
其他好文 时间:
2015-07-12 15:26:42
阅读次数:
116
You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?In order to fulfill...
分类:
其他好文 时间:
2015-07-11 13:35:43
阅读次数:
135
Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2]have the following unique perm...
分类:
其他好文 时间:
2015-07-11 13:22:30
阅读次数:
122
Given a collection of numbers, return all possible permutations.For example,[1,2,3]have the following permutations:[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,...
分类:
其他好文 时间:
2015-07-11 12:07:21
阅读次数:
117
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu...
分类:
其他好文 时间:
2015-07-11 10:34:31
阅读次数:
114
Straight forward idea. Just like the way we multiply numbers. Don't forget considering the carry and be careful. e.g. 123*456,what we usually do is: ....
分类:
其他好文 时间:
2015-07-10 23:38:16
阅读次数:
176
Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.Fo...
分类:
移动开发 时间:
2015-07-10 20:28:55
阅读次数:
141
Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should ru...
分类:
其他好文 时间:
2015-07-10 18:48:28
阅读次数:
80