2014年10月30日
摘要: 题目:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your max... 阅读全文
posted @ 2014-10-30 00:33 higerzhang 阅读(302) 评论(0) 推荐(0) 编辑
  2014年10月29日
摘要: 题目:和上一题一样,就是这时候给定的数字可能有重复。做法:只要将num排好序,然后判断如果当前的值等于前一个的话,那么就跳过,就不会有重复的人。果然是AC了。 1 class Solution { 2 public: 3 vector > permuteUnique(vector &num)... 阅读全文
posted @ 2014-10-29 00:25 higerzhang 阅读(244) 评论(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],... 阅读全文
posted @ 2014-10-29 00:05 higerzhang 阅读(287) 评论(0) 推荐(0) 编辑
  2014年10月28日
摘要: 题目:(这题好难。题目意思类似于第十题,只是这里的*就是可以匹配任意长度串,也就是第十题的‘.*’)'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequenc... 阅读全文
posted @ 2014-10-28 22:31 higerzhang 阅读(353) 评论(0) 推荐(0) 编辑
  2014年10月27日
摘要: 题目:Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-n... 阅读全文
posted @ 2014-10-27 23:12 higerzhang 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 题目:Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining... 阅读全文
posted @ 2014-10-27 00:05 higerzhang 阅读(282) 评论(0) 推荐(0) 编辑
  2014年10月26日
摘要: 题目: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... 阅读全文
posted @ 2014-10-26 22:05 higerzhang 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Each numb... 阅读全文
posted @ 2014-10-26 01:56 higerzhang 阅读(439) 评论(0) 推荐(0) 编辑
  2014年10月25日
摘要: 题目:Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated ... 阅读全文
posted @ 2014-10-25 22:23 higerzhang 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 题目:(据说是facebook的面试题哦)The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or1... 阅读全文
posted @ 2014-10-25 16:30 higerzhang 阅读(1642) 评论(0) 推荐(0) 编辑