摘要:
Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up:Did you use extra space?A s... 阅读全文
posted @ 2014-05-29 16:46
erictanghu
阅读(122)
评论(0)
推荐(0)
摘要:
Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You have the fol... 阅读全文
posted @ 2014-05-29 16:45
erictanghu
阅读(105)
评论(0)
推荐(0)
摘要:
Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"click to show corner cas... 阅读全文
posted @ 2014-05-29 16:44
erictanghu
阅读(129)
评论(0)
推荐(0)
摘要:
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... 阅读全文
posted @ 2014-05-29 16:43
erictanghu
阅读(128)
评论(0)
推荐(0)
摘要:
Implementint sqrt(int x).Compute and return the square root ofx.classSolution{public:intsqrt(intx){inti=0;intstep=1;while(step>0){while((i+step)>1);}r... 阅读全文
posted @ 2014-05-29 16:42
erictanghu
阅读(177)
评论(0)
推荐(0)
摘要:
Given an array of words and a lengthL, format the text such that each line has exactlyLcharacters and is fully (left and right) justified.You should p... 阅读全文
posted @ 2014-05-29 16:41
erictanghu
阅读(131)
评论(0)
推荐(0)
摘要:
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... 阅读全文
posted @ 2014-05-29 16:40
erictanghu
阅读(150)
评论(0)
推荐(0)
摘要:
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... 阅读全文
posted @ 2014-05-29 16:39
erictanghu
阅读(148)
评论(0)
推荐(0)
摘要:
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".classSolution{public:stringaddBinary(stringa,st... 阅读全文
posted @ 2014-05-29 16:38
erictanghu
阅读(104)
评论(0)
推荐(0)
摘要:
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... 阅读全文
posted @ 2014-05-29 16:36
erictanghu
阅读(101)
评论(0)
推荐(0)

浙公网安备 33010602011771号