摘要:
QuestionGiven an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integer... 阅读全文
摘要:
QuestionWrite a function to find the longest common prefix string amongst an array of strings.Solution第一思路是用Trie,但是对于一道Easy类别的题目,用Trie显然是杀鸡用牛刀。于是我们可以参... 阅读全文
摘要:
QuestionGiven a list of words and two wordsword1andword2, return the shortest distance between these two words in the list.For example,Assume that wor... 阅读全文
摘要:
QuestionGiven a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the... 阅读全文
摘要:
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... 阅读全文
摘要:
QuestionGiven a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique lo... 阅读全文
摘要:
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 阅读全文