https://oj.leetcode.com/problems/remove-duplicates-from-sorted-list/http://blog.csdn.net/linhuanmars/article/details/24354291/**
*Definitionforsingly-linkedlist.
*publicclassListNode{
*intval;
*ListNodenext;
*ListNode(intx){
*val=x;
*next=null;
*}
*}
*/
pub..
分类:
其他好文 时间:
2015-01-04 19:31:37
阅读次数:
201
https://oj.leetcode.com/problems/search-in-rotated-sorted-array-ii/http://blog.csdn.net/linhuanmars/article/details/20588511publicclassSolution{
publicbooleansearch(int[]A,inttarget){
if(A==null||A.length==0)
returnfalse;
returnfind(A,0,A.length-1,target);
..
分类:
其他好文 时间:
2015-01-04 19:31:08
阅读次数:
133
https://oj.leetcode.com/problems/remove-duplicates-from-sorted-list-ii/http://blog.csdn.net/linhuanmars/article/details/24389429/**
*Definitionforsingly-linkedlist.
*publicclassListNode{
*intval;
*ListNodenext;
*ListNode(intx){
*val=x;
*next=null;
*}
*}
*/
..
分类:
其他好文 时间:
2015-01-04 19:30:52
阅读次数:
150
https://oj.leetcode.com/problems/unique-paths/http://blog.csdn.net/linhuanmars/article/details/22126357publicclassSolution{
publicintuniquePaths(intm,intn){
if(m<0||n<0)
return-1;//Invalidinput
//Start0,0
//Endm,n
//Useamatrix[m][n].
//Eachelementi..
分类:
其他好文 时间:
2015-01-04 11:36:10
阅读次数:
101
https://oj.leetcode.com/problems/add-binary/http://blog.csdn.net/linhuanmars/article/details/20192227publicclassSolution{
publicStringaddBinary(Stringa,Stringb){
StringBuildersb=newStringBuilder();
char[]charsA=a.toCharArray();
char[]charsB=b.toCharArray(..
分类:
其他好文 时间:
2015-01-04 11:35:00
阅读次数:
156
https://oj.leetcode.com/problems/merge-two-sorted-lists/http://blog.csdn.net/linhuanmars/article/details/19712593/**
*Definitionforsingly-linkedlist.
*publicclassListNode{
*intval;
*ListNodenext;
*ListNode(intx){
*val=x;
*next=null;
*}
*}
*/
publicclassSolu..
分类:
其他好文 时间:
2015-01-04 11:34:49
阅读次数:
147
https://oj.leetcode.com/problems/unique-paths-ii/http://blog.csdn.net/linhuanmars/article/details/22135231publicclassSolution{
publicintuniquePathsWithObstacles(int[][]obstacleGrid){
//Validations
if(obstacleGrid==null||obstacleGrid.length==0||obstacleGrid..
分类:
其他好文 时间:
2015-01-04 11:34:38
阅读次数:
116
https://oj.leetcode.com/problems/minimum-path-sum/http://blog.csdn.net/linhuanmars/article/details/22257673publicclassSolution{
publicintminPathSum(int[][]grid){
//Onlymovedownorright.
//Otherwise,-oo
//Validations.
if(grid==null)
return-1;//Invalidinput
..
分类:
其他好文 时间:
2015-01-04 11:34:38
阅读次数:
154
https://oj.leetcode.com/problems/plus-one/http://blog.csdn.net/linhuanmars/article/details/22365957publicclassSolution{
publicint[]plusOne(int[]digits){
if(digits==null||digits.length==0)
returnnull;
booleancarry=true;
for(inti=digits.length-1;i>=0;i--..
分类:
其他好文 时间:
2015-01-04 11:33:38
阅读次数:
130
https://oj.leetcode.com/problems/sudoku-solver/http://blog.csdn.net/linhuanmars/article/details/20748761publicclassSolution{
publicvoidsolveSudoku(char[][]board){
resolve(board,0,0);
}
privatebooleanresolve(char[][]b,//currentboard
inti,//currentrow
intj)/..
分类:
其他好文 时间:
2015-01-03 13:24:47
阅读次数:
155