
LeetCode
文章平均质量分 77
hidentity
这个作者很懒,什么都没留下…
展开
-
LeetCode 045.Jump Game 2
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.Your goal is to...原创 2018-09-17 22:35:46 · 165 阅读 · 0 评论 -
LeetCode 004.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 O(log (m+n)).You may assume nums1 and n...原创 2018-09-13 21:30:47 · 168 阅读 · 0 评论 -
LeetCode 719.Find K-th Smallest Pair Distance
Given an integer array, return the k-th smallest distance among all the pairs. The distance of a pair (A, B) is defined as the absolute difference between A and B.Example 1:Input:nums = [1,3,1]...原创 2018-09-24 18:29:26 · 307 阅读 · 0 评论 -
LeetCode 030.Substring with Concatenation of All Words
You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in sthat is a concatenation of each word in words exactly once and wit...原创 2018-09-25 18:50:14 · 130 阅读 · 0 评论 -
LeetCode 044.Wildcard Matching
Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including the...原创 2018-09-25 19:07:04 · 122 阅读 · 0 评论 -
LeetCode 456.132 Pattern
Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, ak such that i < j < k and ai < ak < aj. Design an algorithm that takes a list of n numbers as input ...原创 2018-09-26 14:37:38 · 162 阅读 · 0 评论 -
LeetCode 041.First Missing Positive
Given an unsorted integer array, find the smallest missing positive integer.Example 1:Input: [1,2,0]Output: 3Example 2:Input: [3,4,-1,1]Output: 2Example 3:Input: [7,8,9,11,12]Outpu...原创 2019-02-21 23:18:20 · 114 阅读 · 0 评论 -
LeetCode 765. Couples Holding Hands
N couples sit in 2N seats arranged in a row and want to hold hands. We want to know the minimum number of swaps so that every couple is sitting side by side. A swapconsists of choosing any two people,...原创 2019-02-22 01:37:31 · 171 阅读 · 0 评论 -
LeetCode 132. Palindrome Partitioning II
Given a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ofs.Example:Input:"aab"Output: 1Explana...原创 2019-03-03 15:59:01 · 137 阅读 · 0 评论