- 博客(15)
- 收藏
- 关注
原创 658. Find K Closest Elements
本题出处题目描述: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 there is a tie, the smaller elements are alwa
2018-01-03 11:51:06 166
原创 698. Partition to K Equal Sum Subsets
本题出处题目描述:Given an array of integers nums and a positive integer k, find whether it’s possible to divide this array into k non-empty subsets whose sums are all equal.Example 1: Input: nums=[4, 3, 2, 3
2018-01-03 11:01:40 188
原创 712. Minimum ASCII Delete Sum for Two Strings
本题出处题目描述:Given two strings s1, s2, find the lowest ASCII sum of deleted characters to make two strings equal.Example 1: Input: s1 = “sea”, s2 = “eat” Output: 231 Explannation: Deleteing “s” fro
2018-01-02 12:48:24 147
原创 714. Best Time to Buy and Sell Stock with Transaction Fee
本题出处题目描述:Your are given an array of integers prices, for which the i-th element is the price of a given stock on day i; and a non-negative integer fee representing a transaction fee. You may complete
2018-01-01 15:07:01 159
原创 740. Delete and Earn
本题出处题目描述:Given an array nums of integers, you can perform operations on the array.In each operation, you pick any nums[i] and delete it to earn nums[i] points. After, you must delete every element equa
2017-12-31 20:31:10 170
原创 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 O(log (m+n)).Example 1: nums1 = [
2017-12-31 16:19:23 117
原创 Leetcode 84. Largest Rectangle in Histogram
本题出处题目描述:Given n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find the area of largest rectangle in the histogram. Above is a histogram where width o
2017-11-19 22:21:03 123
原创 Leetcode 2. Add Two Numbers
本题出处题目描述:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and
2017-11-19 22:15:13 99
原创 717. 1-bit and 2-bit Characters
本文出处题目描述:We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (10 or 11).Now given a string represented by several bi
2017-11-06 20:24:55 129
原创 Leetcode 718. Maximum Length of Repeated Subarray
本题出处本题是来自于Leetcode的一道题目,算是一道经典题目。最大公共子串问题。此处温馨提醒,注意区分最大公共子串和最大公共子序列。最大公共子串 VS 最大公共子序列问题描述: Given two integer arrays A and B, return the maximum length of an subarray that appears in both arrays.
2017-10-30 22:12:19 220
原创 Leetcode 20. Valid Parentheses
这里写链接内容 Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.The brackets must close in the correct order, “()” and “()[]{}” are all va
2017-10-22 21:00:04 127
原创 Leetcode 41. First Missing Positive
本题出自 Given an unsorted integer array, find the first missing positive integer.For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2.Your algorithm should run in O(n) time and uses constant sp
2017-10-22 20:59:05 111
原创 LeetCode 15 3Sum
本题出处 来自LeetCode Algorithms中的一道Medium的题 原题目: 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
2017-09-24 18:41:00 220
原创 LeetCode 7. Reverse Integer
本题出处 来自LeetCode Algorithms中的一道Easy的题 原题目: Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 Note: The input is assumed to be a 32-bit signed int
2017-09-17 20:01:56 204
原创 LeetCode 3. Longest Substring Without Repeating Characters
本题出处 来自LeetCode Algorithms中的一道Medium的题 原题目: Given a string, find the length of the longest substring without repeating characters.
2017-09-10 19:14:17 193
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人