![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
文章平均质量分 78
nanjunxiao
这个作者很懒,什么都没留下…
展开
-
Leetcode:Wildcard Matching
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 t原创 2013-10-24 22:11:56 · 1112 阅读 · 0 评论 -
Leetcode: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原创 2013-10-23 16:27:01 · 11167 阅读 · 9 评论 -
Leetcode:Combination Sum II
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each number in C may only be used once in the combina原创 2013-10-23 11:33:52 · 914 阅读 · 0 评论 -
Leetcode:Combination Sum
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated number may be chosen from C unlimited numb原创 2013-10-22 23:27:15 · 1050 阅读 · 0 评论 -
最长回文串奇偶情况
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. class Solution {原创 2013-10-06 15:26:19 · 901 阅读 · 0 评论 -
Search for a Range
Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the order of O(log n). If the target is not found原创 2013-10-22 17:03:23 · 806 阅读 · 0 评论 -
Leetcode:Longest Valid Parentheses
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the longest valid parentheses substring is "()",原创 2013-10-22 11:32:31 · 912 阅读 · 0 评论 -
求和问题总结(leetcode 2Sum, 3Sum, 4Sum, K Sum)
转载自: http://tech-wonderland.net/blog/summary-of-ksum-problems.html 前言: 做过leetcode的人都知道, 里面有2sum, 3sum(closest), 4sum等问题, 这些也是面试里面经典的问题, 考察是否能够合理利用排序这个性质, 一步一步得到高效的算法. 经过总结, 本人觉得这些问题都可以使用一转载 2013-10-09 20:51:31 · 12474 阅读 · 0 评论 -
Leetcode:3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exa原创 2013-10-09 20:49:55 · 1347 阅读 · 0 评论 -
Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo原创 2013-10-06 11:46:33 · 621 阅读 · 0 评论 -
两个有序数组的中位数 Median of Two Sorted Arrays
Leetcode上的一道题: There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). class Solutio原创 2013-10-05 23:45:15 · 959 阅读 · 0 评论 -
Regular Expression Matching 正则匹配问题
Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or more of the preceding element. The matching should cover the entire in原创 2013-10-06 21:13:46 · 916 阅读 · 0 评论 -
Leetcode:Trapping Rain Water
Given n non-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. For example, Given [0,1,0,2,1,0,1,3,2,1,2,1]原创 2013-10-23 20:59:41 · 929 阅读 · 0 评论