摘要: 标题:Permutation Sequence通过率:22.7%难度:中等The set[1,2,3,…,n]contains a total ofn! unique permutations.By listing and labeling all of the permutations in or... 阅读全文
posted @ 2015-03-23 22:51 pku_smile 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 标题:Sqrt(x)通过率:22.9%难度:中等Implementint sqrt(int x).Compute and return the square root ofx.利用二分法查找。结果一定在0到x/2+1之间,然后继续找中间值mid,如果mid*mid>x说明结果一定在0到mid-1之间... 阅读全文
posted @ 2015-03-23 21:54 pku_smile 阅读(143) 评论(0) 推荐(0) 编辑