上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 22 下一页
摘要: Sum类的题目一般这样:input: nums[], targetoutput: satisfied arrays/ lists/ number拿到题目,首先分析:1. 是几个数的sum2. sum是要求等于target还是小于还是大于还是closest3. 返回的是原数组下标还是其他对于这类题目,... 阅读全文
posted @ 2015-11-05 02:26 树獭君 阅读(422) 评论(0) 推荐(0) 编辑
摘要: QuestionGiven an array ofnintegersnumsand atarget, find the number of index tripletsi, j, kwith0 = tmpTarget) {11 end--;12 ... 阅读全文
posted @ 2015-11-04 23:45 树獭君 阅读(178) 评论(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 树獭君 阅读(137) 评论(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 树獭君 阅读(433) 评论(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 树獭君 阅读(171) 评论(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 树獭君 阅读(179) 评论(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 树獭君 阅读(166) 评论(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 树獭君 阅读(245) 评论(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 树獭君 阅读(235) 评论(0) 推荐(0) 编辑
摘要: Question Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. F 阅读全文
posted @ 2015-11-03 11:21 树獭君 阅读(124) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 22 下一页