刷题算法
文章平均质量分 75
hanay
这个作者很懒,什么都没留下…
展开
-
LeetCode Longest Substring Without Repeating Characters
Problem: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 lengt原创 2015-10-24 14:54:09 · 197 阅读 · 0 评论 -
Leetcode Longest Palindromic Substring
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.字符串长度为N,一共有N^2种子字符原创 2015-10-26 05:35:08 · 187 阅读 · 0 评论 -
LeetCode ZigZag Conversion
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L S I原创 2015-10-26 06:32:09 · 195 阅读 · 0 评论 -
Leetcode Median of Two Sorted Arrays
ProblemnThere are two sorted arrays nums1 and nums2 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)).思路很不好想的一道题!首先原创 2015-10-25 03:51:04 · 178 阅读 · 0 评论 -
Leetcode 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 input原创 2015-10-27 02:28:12 · 259 阅读 · 0 评论 -
Leetcode Container With Most Water
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 endpoints of linei is at (i, ai) and (i, 0). Find原创 2015-10-27 05:35:10 · 287 阅读 · 0 评论 -
Leetcode Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()()"原创 2015-10-28 01:45:14 · 234 阅读 · 0 评论