赵乐ACM

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
  103 随笔 :: 0 文章 :: 41 评论 :: 96617 阅读

08 2013 档案

摘要:Implement wildcard pattern matching with support for'?'and'*'.'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequence).The matching should cover the entire input string (not partial).The function prototype should be:bool i 阅读全文
posted @ 2013-08-11 09:05 赵乐ACM 阅读(353) 评论(0) 推荐(0) 编辑

摘要:Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-negative.思路:大整数运算的思路,模拟乘法运算代码:class Solution {public: string multiply(string num1, string num2) { int len1 = num1.size(), len2 = num2.size(), le... 阅读全文
posted @ 2013-08-10 10:45 赵乐ACM 阅读(3044) 评论(1) 推荐(1) 编辑

摘要: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 run inO(n) time and uses constant space.找到第一个没有出现的正整数思路:http://tech-wonderland.net/blog/leetcode-first-missing-positive.html就是把出现的正整数a都放在a-1的位置,然后从头开始历遍 阅读全文
posted @ 2013-08-07 16:59 赵乐ACM 阅读(1343) 评论(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 number inCmay only be usedoncein the combination.Note:All numbers (including target) will be positive integers.Elements in a combination (a1,a2, � ,ak) must 阅读全文
posted @ 2013-08-07 15:50 赵乐ACM 阅读(658) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示