摘要: You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without any intervening characters.For example, given:S: "barfoothefoobarman"L: ["foo", &q 阅读全文
posted @ 2012-10-18 23:56 ETCOW 阅读(491) 评论(0) 推荐(0) 编辑
摘要: Given a collection of integers that might contain duplicates, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.For example,If S = [1,2,2], a solution is:[[2],[1],[1,2,2],[2,2],[1,2],[]] 1 public stati... 阅读全文
posted @ 2012-10-18 22:42 ETCOW 阅读(396) 评论(0) 推荐(0) 编辑
摘要: Given a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.For example,If S = [1,2,3], a solution is:[[3],[1],[2],[1,2,3],[1,3],[2,3],[1,2],[]] 1 public static List<List<int>& 阅读全文
posted @ 2012-10-18 22:38 ETCOW 阅读(362) 评论(0) 推荐(0) 编辑
摘要: Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases.Notes: It is intended for this problem to be specified vaguely (ie, no given input specs). You are r 阅读全文
posted @ 2012-10-18 00:44 ETCOW 阅读(863) 评论(0) 推荐(0) 编辑