摘要:
QuestionGiven an array ofnintegersnumsand atarget, find the number of index tripletsi, j, kwith0 = tmpTarget) {11 end--;12 ... 阅读全文
posted @ 2015-11-04 23:45
树獭君
阅读(183)
评论(0)
推荐(0)
摘要:
QuestionGiven an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integer... 阅读全文
posted @ 2015-11-04 22:43
树獭君
阅读(150)
评论(0)
推荐(0)
摘要:
Roman Numeral ChartV:5 X:10 L:50 C:100 D:500 M:1000规则:1. 重复次数表示该数的倍数2. 右加左减:较大的罗马数字右边记上较小的罗马数字,表示大数字加小数字较小的罗马数字右边记上较大的罗马数字,表示大数字减小数字左减的数字有限制,仅限于I... 阅读全文
posted @ 2015-11-04 12:49
树獭君
阅读(443)
评论(0)
推荐(0)
摘要:
QuestionWrite a function to find the longest common prefix string amongst an array of strings.Solution第一思路是用Trie,但是对于一道Easy类别的题目,用Trie显然是杀鸡用牛刀。于是我们可以参... 阅读全文
posted @ 2015-11-04 10:02
树獭君
阅读(185)
评论(0)
推荐(0)
摘要:
QuestionGiven a list of words and two wordsword1andword2, return the shortest distance between these two words in the list.For example,Assume that wor... 阅读全文
posted @ 2015-11-04 09:21
树獭君
阅读(184)
评论(0)
推荐(0)
摘要:
QuestionGiven a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the... 阅读全文
posted @ 2015-11-04 09:11
树獭君
阅读(171)
评论(0)
推荐(0)
摘要:
QuestionGiven a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to thedefinition of LCA on Wik... 阅读全文
posted @ 2015-11-04 02:07
树獭君
阅读(253)
评论(0)
推荐(0)
摘要:
QuestionGiven a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique lo... 阅读全文
posted @ 2015-11-04 00:50
树獭君
阅读(240)
评论(0)
推荐(0)

浙公网安备 33010602011771号