LeetCode 11. Container With Most Water(java)

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 endpoi...

2018-02-26 05:01:40

阅读数:46

评论数:0

LeetCode 191. Number of 1 Bits(java)

Write a function that takes an unsigned integer and returns the number of ’1’ bits it has (also known as the Hamming weight).For example, the 32-bit ...

2018-02-26 03:47:30

阅读数:28

评论数:0

LeetCode 83. Remove Duplicates from Sorted List(java)

You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1...

2018-02-26 02:16:37

阅读数:42

评论数:0

LeetCode 658. Find K Closest Elements(java)

Given a sorted array, two integers k and x, find the k closest elements to x in the array. The result should also be sorted in ascending order. If th...

2018-02-25 17:31:31

阅读数:391

评论数:0

LeetCode 134. Gas Station(java)

There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it cost...

2018-02-25 17:08:04

阅读数:55

评论数:0

LeetCode 560. Subarray Sum Equals K(java)

Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn’t one, return 0 instead.Note: The sum o...

2018-02-25 08:59:20

阅读数:48

评论数:0

LeetCode 325. Maximum Size Subarray Sum Equals k(java)

Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn’t one, return 0 instead.Note: The sum o...

2018-02-25 08:26:15

阅读数:64

评论数:0

LeetCode 713. Subarray Product Less Than K(java)

Your are given an array of positive integers nums.Count and print the number of (contiguous) subarrays where the product of all the elements in the s...

2018-02-25 08:14:08

阅读数:48

评论数:0

LeetCode 152. Maximum Product Subarray(java)

Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4], ...

2018-02-25 07:30:20

阅读数:33

评论数:0

LeetCode 340. Longest Substring with At Most K Distinct Characters(java)

Given a string, find the length of the longest substring T that contains at most k distinct characters.For example, Given s = “eceba” and k = 2,T is ...

2018-02-12 11:49:48

阅读数:121

评论数:0

LeetCode 159. Longest Substring with At Most Two Distinct Characters(java)

Given a string, find the length of the longest substring T that contains at most 2 distinct characters.For example, Given s = “eceba”,T is "ece&...

2018-02-12 11:45:26

阅读数:82

评论数:0

LeetCode 76. Minimum Window Substring(java)

Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example, S = "AD...

2018-02-12 11:41:53

阅读数:39

评论数:0

LeetCode 53. Maximum Subarray

Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,...

2018-02-12 09:17:36

阅读数:44

评论数:0

LeetCode 3. Longest Substring Without Repeating Characters(java)

Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc&qu...

2018-02-12 02:08:43

阅读数:41

评论数:0

LeetCode 562. Longest Line of Consecutive One in Matrix(java)

Given a 01 matrix M, find the longest line of consecutive one in the matrix. The line could be horizontal, vertical, diagonal or anti-diagonal.Exampl...

2018-02-11 15:58:57

阅读数:198

评论数:0

LeetCode 674. Longest Continuous Increasing Subsequence(java)

Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray).Example 1: Input: [1,3,5,4,7] Output: 3 ...

2018-02-11 15:56:35

阅读数:51

评论数:0

LeetCode 591. Tag Validator(java)

Given a string representing a code snippet, you need to implement a tag validator to parse the code and return whether it is valid. A code snippet is...

2018-02-11 15:50:45

阅读数:58

评论数:0

LeetCode 722. Remove Comments(java)

Given a C++ program, remove comments from it. The program source is an array where source[i] is the i-th line of the source code. This represents the...

2018-02-11 15:39:38

阅读数:136

评论数:0

LeetCode 480. Sliding Window Median(java)

Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the tw...

2018-02-09 11:44:58

阅读数:62

评论数:0

LeetCode 394. Decode String(java)

Given an encoded string, return it’s decoded string.The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is b...

2018-02-07 12:00:21

阅读数:102

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭