摘要:
Implementint sqrt(int x).Compute and return the square root ofx.方法相当2b之前判定超时, 于是用到了class Solution {public: int sqrt(int x) { if(x==0) ... 阅读全文
摘要:
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... 阅读全文
摘要:
Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your algorithm to use onlyO(... 阅读全文
摘要:
GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]... 阅读全文
摘要:
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... 阅读全文
摘要:
本人使用环境: ubuntu13.10 64bit记录一些实用的命令:1. du -sh dir 查询dir的总大小, 有时要sudo du -Sh dir 查询dir各目录的大小, 有时sudo2. 安装rsapip install rsaeasy_install rsa这两个应该还可以安... 阅读全文