程序媛詹妮弗
终身学习
摘要: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex 阅读全文
posted @ 2018-05-24 06:59 程序媛詹妮弗 阅读(205) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both 阅读全文
posted @ 2018-05-23 03:55 程序媛詹妮弗 阅读(361) 评论(0) 推荐(0) 编辑
摘要: Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. Example: 题 阅读全文
posted @ 2018-05-23 03:24 程序媛詹妮弗 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequ 阅读全文
posted @ 2018-05-23 03:17 程序媛詹妮弗 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 何谓动态规划? 以菲波那切数列为例, 该递归调用中,有大量重复子集,如图 在计算fib(5) 的时候,多次计算了fib(2)的值。那为何不在递归搜索的基础上,添加一个小笔记本进行记忆化:只在第一次fib(2)的时候计算结果,而下次再call fib(2)的时候, 可以直接O(1)时间从记事本拿到该结 阅读全文
posted @ 2018-05-22 07:13 程序媛詹妮弗 阅读(641) 评论(0) 推荐(0) 编辑
摘要: A message containing letters from A-Z is being encoded to numbers using the following mapping: Given a non-empty string containing only digits, determ 阅读全文
posted @ 2018-05-22 06:33 程序媛詹妮弗 阅读(156) 评论(0) 推荐(0) 编辑
摘要: Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen 阅读全文
posted @ 2018-05-22 04:58 程序媛詹妮弗 阅读(213) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero sub-node. 阅读全文
posted @ 2018-05-22 03:15 程序媛詹妮弗 阅读(91) 评论(0) 推荐(0) 编辑
摘要: Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the or 阅读全文
posted @ 2018-05-22 03:01 程序媛詹妮弗 阅读(173) 评论(0) 推荐(0) 编辑
摘要: Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). Example: Input: S = "ADOB 阅读全文
posted @ 2018-05-22 02:15 程序媛詹妮弗 阅读(217) 评论(0) 推荐(0) 编辑