leetcode算法
wenanshi
这个作者很懒,什么都没留下…
展开
-
LeetCode 算法刷题(11)
11. Container With Most WaterGiven 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 lin原创 2017-03-27 18:01:31 · 718 阅读 · 0 评论 -
LeetCode 算法刷题(4)
4. Median of Two Sorted Arrays There 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原创 2016-08-01 14:22:21 · 416 阅读 · 0 评论 -
LeetCode 算法刷题(373)
373. Find K Pairs with Smallest Sums You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k.Define a pair (u,v) which consists of one element from the原创 2016-07-25 15:59:09 · 576 阅读 · 0 评论 -
LeetCode 算法刷题(6)
6. ZigZag ConversionThe 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)原创 2017-03-22 13:30:22 · 239 阅读 · 0 评论 -
LeetCode 算法刷题(5)
5. Longest Palindromic SubstringGiven a string s, find the longest palindromic substring in s. You may assume that the maximum length of sis 1000.Example:Input: "babad"Output: "bab"Not原创 2017-03-22 13:33:59 · 313 阅读 · 0 评论 -
LeetCode 算法刷题(3)
3. Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc",原创 2016-07-25 15:55:46 · 652 阅读 · 4 评论 -
LeetCode 算法刷题(9)
9. Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (ie, -1)If you原创 2017-03-23 18:29:24 · 243 阅读 · 0 评论 -
LeetCode 算法刷题(7)
7. Reverse IntegerReverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Note:The input is assumed to be a 32-bit signed原创 2017-03-22 13:27:00 · 973 阅读 · 0 评论 -
LeetCode 算法刷题(12)
12. Integer to RomanGiven an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.罗马数字罗马数字是古罗马时期的计数系统,也是最早的数字表示方式,多用于钟表、日历和章节编号。一般认为,罗马数字只原创 2017-04-03 13:54:32 · 474 阅读 · 0 评论 -
LeetCode 算法刷题(10)
10. Regular Expression MatchingImplement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The ma原创 2017-03-26 14:41:34 · 348 阅读 · 0 评论 -
LeetCode 算法刷题(13)
13. Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.public int romanToInt(String s) { int result = 0;原创 2017-04-05 17:00:23 · 317 阅读 · 0 评论