摘要:
更多内容敬请期待。解法是否最优不能保证,但OJ肯定是能过的。1: Two Sum2:Median of Two Sorted Arrays3: Longest Substring Without Repeating Characters4:Add Two Numbers5:Longest Palindromic Substring6:ZigZag Conversion7:Reverse Integer8:String to Integer (atoi)9:Palindrome Number10:Regular Expression Matching11:Container With Most 阅读全文
摘要:
http://oj.leetcode.com/problems/first-missing-positive/Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm should run in O(n) time and uses constant space.思路:显然排序数数的方法是不能用了。解决的思路很简单,我们要找的是第一个没有出现的正数,那么如果我们 阅读全文