算法
panzejia
这个作者很懒,什么都没留下…
展开
-
【Leetcode解题记录】5. 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.Example:Input: "babad" Output: "bab" Note: "aba" is also a valid answer. Example:I...转载 2018-02-10 14:02:33 · 120 阅读 · 0 评论 -
【Leetcode解题记录】6. 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 N A P L S I I G ...原创 2018-02-12 23:00:17 · 140 阅读 · 0 评论 -
【Leetcode解题记录】11. 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 line i is at (i, ai) and (i, 0). Find two ...原创 2018-02-12 23:08:44 · 117 阅读 · 0 评论 -
【Leetcode解题记录】12. Integer to Roman
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.-------比较简单,只要了解罗马数字的转换即可。对应规则如下:{"","I","II","III","IV","V","VI","VII"原创 2018-02-12 23:16:16 · 134 阅读 · 0 评论 -
【Leetcode解题记录】15. 3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: The solution set must not contain dupli...原创 2018-02-12 23:24:34 · 167 阅读 · 0 评论 -
【Leetcode解题记录】3. Longest Substring Without Repeating Characte
寻找最长不重复字串Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "b", w...转载 2018-02-12 22:55:34 · 116 阅读 · 0 评论 -
【Leetcode解题记录】17. Letter Combinations of a Phone Number
Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.Input:Digit string "23" ...原创 2018-02-13 16:38:21 · 168 阅读 · 0 评论 -
【Leetcode解题记录】4. Median of Two Sorted Arrays
转载于:【分步详解】两个有序数组中的中位数和Top K问题有时间还是要写一下两个数组的Top K代码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 sho...转载 2018-02-14 21:17:35 · 190 阅读 · 0 评论