![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode
文章平均质量分 55
Felix_CY
这个作者很懒,什么都没留下…
展开
-
【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. 给定一个字符串s,找到s中最长的回文子字符串。 您可以假设s的最大长度为1000 输入输出: 1. Input: "babad" Output: "bab...原创 2018-08-04 15:31:07 · 130 阅读 · 0 评论 -
【LeetCode】[90]Subsets II
Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. Example: Input: [1,2,2] ...原创 2018-08-09 10:24:54 · 145 阅读 · 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...原创 2018-08-04 21:36:42 · 153 阅读 · 0 评论 -
【Leetcode】[46] Permutations
Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ] 题目:给定不同的整数序列,输出所有可能的...原创 2018-08-09 21:09:18 · 140 阅读 · 0 评论 -
【Leetcode】[39] Combination Sum
Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target. The same repeat...原创 2018-08-10 21:56:55 · 209 阅读 · 0 评论 -
【笔试】区间合并
做笔试题遇到一道区间合并的题目,给定若干区间[1,2] [2,3] [4,5]合并有覆盖的区间,即为[1,3] [4,5]。经过在网上搜索类似题目,得到两种解题思路。类似题目是LeetCode上的56题目 思路1.如果区间的端点范围很小,比如在范围[0,9999]。可以开一个10000大小的bool数组,然后输入区间覆盖的范围都复制true。则最后遍历数组,连续的true数据即为一个区间。这种...原创 2018-08-12 15:44:08 · 1349 阅读 · 0 评论 -
【LeetCode】[55] Jump Game
Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Determine if yo...原创 2018-08-19 22:10:24 · 138 阅读 · 0 评论 -
【Leetcode】[53] Maximum Subarray
Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: Input: [-2,1,-3,4,-1,2,1,-5,4], Output: 6 Explanati...原创 2018-08-19 22:42:29 · 154 阅读 · 0 评论 -
【LeetCode】[56] Merge Intervals
Given a collection of intervals, merge all overlapping intervals. Example 1: Input: [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]] Explanation: Since intervals [1,3] and [2,6] overlaps...原创 2019-04-30 18:28:12 · 206 阅读 · 1 评论