06 2014 档案

摘要:Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3,4], [2,3],... 阅读全文
posted @ 2014-06-30 20:37 Double_win 阅读(253) 评论(0) 推荐(0)
摘要:过几天就要进行华为的机试了,今儿临时抱抱佛脚,在网上找到2014届华为校招的机试题,琢磨了一会儿,贴出来记录下。首先感谢一下Hackbuteer提供的题目:http://blog.csdn.net/hackbuteer1/article/details/11132567对于第一题,字符过滤。最简单也... 阅读全文
posted @ 2014-06-27 11:15 Double_win 阅读(614) 评论(0) 推荐(0)
摘要:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephon... 阅读全文
posted @ 2014-06-24 23:03 Double_win 阅读(354) 评论(0) 推荐(0)
摘要:The set[1,2,3,…,n]contains a total ofn! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie... 阅读全文
posted @ 2014-06-18 16:30 Double_win 阅读(239) 评论(0) 推荐(0)
摘要:Given a collection of numbers, return all possible permutations.For example,[1,2,3]have the following permutations:[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,... 阅读全文
posted @ 2014-06-18 13:41 Double_win 阅读(172) 评论(0) 推荐(0)
摘要:Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should ru... 阅读全文
posted @ 2014-06-17 23:11 Double_win 阅读(253) 评论(0) 推荐(0)
摘要:Write a function to find the longest common prefix string amongst an array of strings.题解: 寻找一组字符串的最长公共前缀。最简单的方法,用一个字符串记录当前最长的公共前缀,然后依次比较。时间复杂度: O(N). ... 阅读全文
posted @ 2014-06-17 21:17 Double_win 阅读(412) 评论(0) 推荐(0)
摘要:Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2]have the following unique perm... 阅读全文
posted @ 2014-06-17 18:14 Double_win 阅读(252) 评论(0) 推荐(0)
摘要:Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))... 阅读全文
posted @ 2014-06-17 16:27 Double_win 阅读(274) 评论(0) 推荐(0)
摘要:Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After re... 阅读全文
posted @ 2014-06-17 14:58 Double_win 阅读(210) 评论(0) 推荐(0)
摘要:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the 阅读全文
posted @ 2014-06-16 23:27 Double_win 阅读(158) 评论(0) 推荐(0)
摘要:Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be in lower-case. 题解: 判断字符串是否为回文构词法生成的。找出所有由同一回文构词法生成 阅读全文
posted @ 2014-06-11 16:15 Double_win 阅读(218) 评论(0) 推荐(0)
摘要:The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11.11 is read off 阅读全文
posted @ 2014-06-11 10:36 Double_win 阅读(255) 评论(0) 推荐(0)
摘要:Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted f 阅读全文
posted @ 2014-06-10 22:28 Double_win 阅读(176) 评论(0) 推荐(0)
摘要:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan 阅读全文
posted @ 2014-06-10 20:55 Double_win 阅读(207) 评论(0) 推荐(0)
摘要:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo 阅读全文
posted @ 2014-06-07 14:44 Double_win 阅读(217) 评论(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 阅读全文
posted @ 2014-06-01 17:50 Double_win 阅读(460) 评论(0) 推荐(0)
摘要:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single 阅读全文
posted @ 2014-06-01 15:10 Double_win 阅读(194) 评论(0) 推荐(0)