码迷,mamicode.com
首页 >  
搜索关键字:leedcode    ( 225个结果
[leedcode 74] Search a 2D Matrix
Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from l...
分类:其他好文   时间:2015-07-14 19:35:04    阅读次数:103
[leedcode 69] Sqrt(x)
Implementint sqrt(int x).Compute and return the square root ofx.public class Solution { //本题利用了牛顿迭代法:设r是f(x) = 0的根(x^2-k=f(x)),选取x0作为r初始近似值,过点(x0,f...
分类:其他好文   时间:2015-07-13 23:59:22    阅读次数:371
[leedcode 71] Simplify Path
Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"public class Solution { ...
分类:其他好文   时间:2015-07-13 23:57:11    阅读次数:159
[leedcode 70] Climbing Stairs
You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb...
分类:其他好文   时间:2015-07-13 23:41:44    阅读次数:113
[leedcode 67] Add Binary
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".public class Solution { public String addBin...
分类:其他好文   时间:2015-07-13 22:15:12    阅读次数:114
[leedcode 65] Valid Number
Validate if a given string is numeric.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>trueNote:It is intended for the problem stat...
分类:其他好文   时间:2015-07-13 20:22:00    阅读次数:138
[leedcode 66] Plus One
Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at...
分类:其他好文   时间:2015-07-13 20:16:45    阅读次数:116
[leedcode 64] Minimum Path Sum
Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:Yo...
分类:其他好文   时间:2015-07-13 18:02:11    阅读次数:127
[leedcode 63] Unique Paths II
Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i...
分类:其他好文   时间:2015-07-13 17:34:45    阅读次数:95
[leedcode 61] Rotate List
Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL./** *...
分类:其他好文   时间:2015-07-13 15:52:28    阅读次数:79
225条   上一页 1 ... 15 16 17 18 19 ... 23 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!