2015年12月4日

摘要: Sqrt(x)Implement int sqrt(int x).Compute and return the square root of x.Examplesqrt(3) = 1sqrt(4) = 2sqrt(5) = 2sqrt(10) = 3ChallengeO(log(x))直接的做法是注... 阅读全文
posted @ 2015-12-04 05:06 一心一念 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Valid SudokuDetermine whether a Sudoku is valid.The Sudoku board could be partially filled, where empty cells are filled with the character ..ExampleT... 阅读全文
posted @ 2015-12-04 03:31 一心一念 阅读(156) 评论(0) 推荐(0) 编辑

2015年12月3日

摘要: Compare StringsCompare two strings A and B, determine whether A contains all of the characters in B.The characters in string A and B are all Upper Cas... 阅读全文
posted @ 2015-12-03 04:28 一心一念 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Product of Array Exclude ItselfGiven an integers array A.Define B[i] = A[0] * ... * A[i-1] * A[i+1] * ... * A[n-1], calculate B WITHOUT divide operati... 阅读全文
posted @ 2015-12-03 04:12 一心一念 阅读(282) 评论(0) 推荐(0) 编辑
摘要: Insert Node in a Binary Search TreeExampleGiven binary search tree as follow, after Insert node 6, the tree should be: 2 2 / \ ... 阅读全文
posted @ 2015-12-03 04:12 一心一念 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Permutation IndexGiven a permutation which contains no repeated number, find its index in all the permutations of these numbers, which are ordered in ... 阅读全文
posted @ 2015-12-03 03:40 一心一念 阅读(680) 评论(0) 推荐(0) 编辑
摘要: 第1部分 HashMap介绍HashMap简介HashMap 是一个散列表,它存储的内容是键值对(key-value)映射。HashMap 继承于AbstractMap,实现了Map、Cloneable、java.io.Serializable接口。HashMap 的实现不是同步的,这意味着它不是线... 阅读全文
posted @ 2015-12-03 02:33 一心一念 阅读(250) 评论(0) 推荐(0) 编辑

2015年12月2日

摘要: TriangleGiven a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.ExampleFor example... 阅读全文
posted @ 2015-12-02 16:06 一心一念 阅读(524) 评论(0) 推荐(0) 编辑
摘要: Subarray SumExampleGiven [-3, 1, 2, -3, 4], return [0, 2] or [1, 3].NoteThere is at least one subarray that it's sum equals to zero.public class Solut... 阅读全文
posted @ 2015-12-02 07:07 一心一念 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Unique Paths IIFollow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle an... 阅读全文
posted @ 2015-12-02 06:23 一心一念 阅读(118) 评论(0) 推荐(0) 编辑

导航