Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2015-06-14 16:30:11
阅读次数:
79
1 题目:Write a function to find the longest common prefix string amongst an array of strings.Hide TagsString2 思路所有字符串公共的前缀,那么第一个字符串肯定包括了。 从第一个字符串开始遍历着手即...
分类:
其他好文 时间:
2015-06-14 16:26:59
阅读次数:
102
打算用nodejs写一个blog系统,发现nodejs还是存在很多的坑。在使用mongodb时遇到如下报错问题:
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS ...
分类:
数据库 时间:
2015-06-14 15:16:53
阅读次数:
749
Find the seed of a number.Eg : 1716 = 143*1*4*3 =1716 so 143 is the seed of 1716. find all possible seed for a given number.辗转相除法,由性质可利用 sqrt(num) <= ...
分类:
其他好文 时间:
2015-06-14 15:05:22
阅读次数:
181
题目:Given two words (startandend), and a dictionary, find all shortest transformation sequence(s) fromstarttoend, such that:Only one letter can be chan...
分类:
编程语言 时间:
2015-06-14 15:01:43
阅读次数:
216
Description:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices o...
分类:
其他好文 时间:
2015-06-14 13:44:40
阅读次数:
119
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the target, whe...
分类:
其他好文 时间:
2015-06-14 09:37:20
阅读次数:
103
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example,
Given[3,2,1,5,6,4]and k = 2, return 5.Note:...
分类:
其他好文 时间:
2015-06-14 09:34:25
阅读次数:
120
Substring with Concatenation of All Words
题目:
You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a conc...
分类:
其他好文 时间:
2015-06-14 09:30:12
阅读次数:
110
Majority ElementGiven an array of sizen, find the majority element. The majority element is the element that appears more than? n/2 ?times.You may ass...
分类:
编程语言 时间:
2015-06-14 08:14:08
阅读次数:
143