2014年5月2日
摘要: 2014-05-02 10:47题目链接原题:1 Given an unordered array of positive integers, create an algorithm that makes sure no group of integers of size bigger than M... 阅读全文
posted @ 2014-05-02 11:03 zhuli19901106 阅读(304) 评论(0) 推荐(0)
摘要: 2014-05-02 10:40题目链接原题:Sink Zero in Binary Tree. Swap zero value of a node with non-zero value of one of its descendants so that no node with value ze... 阅读全文
posted @ 2014-05-02 10:46 zhuli19901106 阅读(714) 评论(0) 推荐(0)
摘要: 2014-05-02 10:07题目链接原题:Mapping '1' = 'A','B','C' '2' = 'D','E','F' ... '9' = input: 112 output :ouput = [AAD, BBD, CCD, AAE, AAF, BBE, BBF, CCE, CCF]题... 阅读全文
posted @ 2014-05-02 10:40 zhuli19901106 阅读(328) 评论(0) 推荐(0)
摘要: 2014-05-02 09:59题目链接原题:Group Anagrams input = ["star, astr, car, rac, st"] output = [["star, astr"],["car","rac"],["st"]);题目:给定一堆字符串,设法把anagram都排在一起。解... 阅读全文
posted @ 2014-05-02 10:05 zhuli19901106 阅读(236) 评论(0) 推荐(0)
摘要: 2014-05-02 09:54题目链接原题:You have two numbers decomposed in binary representation, write a function that sums them and returns the result. Input: 100011... 阅读全文
posted @ 2014-05-02 09:59 zhuli19901106 阅读(183) 评论(0) 推荐(0)
摘要: 2014-05-02 09:40题目链接原题:Given a number N, write a program that returns all possible combinations of numbers that add up to N, as lists. (Exclude the N+... 阅读全文
posted @ 2014-05-02 09:54 zhuli19901106 阅读(179) 评论(0) 推荐(0)
摘要: 2014-05-02 08:29题目链接原题:Write a function for retrieving the total number of substring palindromes. For example the input is 'abba' then the possible pa... 阅读全文
posted @ 2014-05-02 09:33 zhuli19901106 阅读(225) 评论(0) 推荐(0)
摘要: 2014-05-02 07:49题目链接原题:Given a set of n points (coordinate in 2d plane) within a rectangular space, find out a line (ax+by=c), from which the sum of t... 阅读全文
posted @ 2014-05-02 08:24 zhuli19901106 阅读(319) 评论(0) 推荐(0)
摘要: 2014-05-02 07:37题目链接原题:// merge sorted arrays 'a' and 'b', each with 'length' elements, // in-place into 'b' to form a sorted result. assume that 'b' ... 阅读全文
posted @ 2014-05-02 07:46 zhuli19901106 阅读(231) 评论(0) 推荐(0)
摘要: 2014-05-02 07:18题目链接原题:boolean isBST(const Node* node) { // return true iff the tree with root 'node' is a binary search tree. // 'node' is guaranteed... 阅读全文
posted @ 2014-05-02 07:36 zhuli19901106 阅读(272) 评论(0) 推荐(0)
摘要: 2014-05-02 07:06题目链接原题:Given an array of randomly sorted integers and an integer k, write a function which returns boolean True if a pair of numbers e... 阅读全文
posted @ 2014-05-02 07:16 zhuli19901106 阅读(242) 评论(0) 推荐(0)
摘要: 2014-05-02 03:37题目链接原题:A string is called sstring if it consists of lowercase english letters and no two of its consecutive characters are the same. Y... 阅读全文
posted @ 2014-05-02 06:58 zhuli19901106 阅读(243) 评论(0) 推荐(0)
摘要: 2014-05-02 03:19题目链接原题:Given a sequence of numbers A(1) ..A(n), find the continuous subsequenceA(i)..A(j) for which the sum of elements is maximum. co... 阅读全文
posted @ 2014-05-02 03:30 zhuli19901106 阅读(348) 评论(0) 推荐(0)
摘要: 2014-05-02 02:33题目链接原题:Given the following 3 by 3 grid where the (first row, first column) is represented by (0,0): 0,1 1,2 3,3 1,1 3,3 3,2 3,0 1,3 nu... 阅读全文
posted @ 2014-05-02 02:34 zhuli19901106 阅读(186) 评论(0) 推荐(0)
摘要: 2014-05-02 02:28题目链接原题:I/P: N, k O/P: all subset of N with exactly K elements. eg: I/p: N = 5, K =3 O/p: 1 2 3 1 2 4 1 2 5 1 3 4 1 3 5 2 3 4 2 3 5 3 4... 阅读全文
posted @ 2014-05-02 02:29 zhuli19901106 阅读(208) 评论(0) 推荐(0)
摘要: 2014-05-02 01:05题目链接原题:bool anaStrStr (string needle, string haystack) {}Write a function that takes 2 strings , search returns true if any anagram of... 阅读全文
posted @ 2014-05-02 01:21 zhuli19901106 阅读(295) 评论(0) 推荐(0)
摘要: 2014-05-02 00:59题目链接原题:Given a normal binary tree, write a function to serialize the tree into a string representation (returning the string), and als... 阅读全文
posted @ 2014-05-02 01:03 zhuli19901106 阅读(186) 评论(0) 推荐(0)
摘要: 2014-05-02 00:30题目链接原题:Given two arrays of sorted integers, merge them keeping in mind that there might be common elements in the arrays and that comm... 阅读全文
posted @ 2014-05-02 00:39 zhuli19901106 阅读(169) 评论(0) 推荐(0)
摘要: 2014-05-02 00:22题目链接原题:Given a matrix consisting of 0's and 1's, find the largest connected component consisting of 1's.题目:给定一个01矩阵,找出由1构成的连通分量中最大的一个。... 阅读全文
posted @ 2014-05-02 00:30 zhuli19901106 阅读(250) 评论(0) 推荐(0)