- 博客(135)
- 收藏
- 关注
转载 LeetCode699. Falling Squares
On an infinite number line (x-axis), we drop given squares in the order they are given.Thei-th square dropped (positions[i] = (left, side_length)) is a square with the left-most point beingpo...
2018-10-04 15:03:00
262
转载 LeetCode691. Stickers to Spell Word
We are given N different types of stickers. Each sticker has a lowercase English word on it.You would like to spell out the giventargetstring by cutting individual letters from your collectio...
2018-10-02 00:47:00
293
转载 LeetCode664. Strange Printer
There is a strange printer with the following two special requirements:The printer can only print a sequence of the same character each time.At each turn, the printer can print new characte...
2018-09-29 16:54:00
271
转载 LeetCode517. Super Washing Machines
You havensuper washing machines on a line. Initially, each washing machine has some dresses or is empty.For eachmove, you could chooseany m(1 ≤ m ≤ n) washing machines, and passone dress...
2018-09-29 15:45:00
225
转载 LeetCode446. Arithmetic Slices II - Subsequence
A sequence of numbers is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.For example, these are arithmetic seq...
2018-09-28 23:35:00
136
转载 LeetCode403. Frog Jump
A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but it must not jump into the water.Given a list...
2018-09-28 21:31:00
123
转载 LeetCode282. Expression Add Operators
Given a string that contains only digits0-9and a target value, return all possibilities to addbinaryoperators (not unary)+,-, or*between the digits so they evaluate to the target value.E...
2018-09-28 00:04:00
101
转载 LeetCode828. Unique Letter String
https://leetcode.com/problems/unique-letter-string/description/A character is unique in stringSif it occurs exactly once in it.For example, in stringS = "LETTER", the only unique character...
2018-09-26 23:41:00
186
转载 新单词和语法的学习(英文)
1. 习惯于be used to be accustomed toeg:I'musedtoloneliness. / 我已习惯孤独 Heisaccustomedtohardwork. / 他习惯艰苦工作 Sheusedtomakeaspeechinpublic. / 她过去习惯于在大众下发表演讲。 注意这里的 us...
2018-09-24 12:13:00
351
转载 算法笔试题整理——升级蓄水池 && 字符串数字表达式计算值 && 求旅游完所有景点需要的最少天数 && 宝箱怪...
1. 小米笔试题——升级蓄水池题目描述:在米兔生活的二维世界中,建造蓄水池非常简单。一个蓄水池可以用n个坐标轴上的非负整数表示,代表区间为【0-n】范围内宽度为1的墙壁的高度。如下图1,黑色部分是墙壁,墙壁的高度是[0,1,0,2,1,0,1,3,2,1,2,1] ,蓝色部分是蓄水的面积,可以看出蓄水池最大蓄水容量是6。现在米兔想通过增加某些墙壁的高度对蓄水池扩容,但...
2018-09-23 00:35:00
780
转载 一些相似单词的区别之处
1. devote 和 contributehttps://zhidao.baidu.com/question/328034454447561365.htmlcontribute to 和devote to区别1、devote to:专心致力于,把…专用于,另外还有听任的意思。2、contribute to:捐助,帮助,贡献,出力;给…投稿的意思。3、contribute (mo...
2018-09-22 17:41:00
992
转载 算法刷题细节点总结
1. 关于集合(1) 关于map遍历map:https://www.cnblogs.com/imzhj/p/5981665.html感觉最好记的方法是这个:Map<String, String> map = new HashMap<String, String>();for (Entry<String, String> en...
2018-09-18 12:16:00
93
转载 LeetCode301. Remove Invalid Parentheses
Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results.Note:The input string may contain letters other than the parentheses(and...
2018-09-18 12:16:00
98
转载 LeetCode765. 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. Aswapconsists of choosinganytwo p...
2018-08-28 17:11:00
112
转载 LeetCode741. Cherry Pickup
https://leetcode.com/problems/cherry-pickup/description/In a N x Ngridrepresenting a field of cherries, each cell is one of three possible integers.0 means the cell is empty, so you can ...
2018-08-28 01:22:00
136
转载 LeetCode312. Burst Balloons
Givennballoons, indexed from0ton-1. Each balloon is painted with a number on it represented by arraynums. You are asked to burst all the balloons. If the you burst ballooniyou will getnu...
2018-08-21 02:15:00
121
转载 LeetCode679. 24 Game
You have 4 cards each containing a number from 1 to 9. You need to judge whether they could operated through*,/,+,-,(,)to get the value of 24.Example 1:Input: [4, 1, 8, 7]Output: Tru...
2018-08-20 00:42:00
188
转载 LeetCode862. Shortest Subarray with Sum at Least K
Return thelengthof the shortest, non-empty, contiguoussubarray ofAwith sum at leastK.If there is no non-empty subarray with sum at leastK, return-1.Example 1:Input: A = [1], K = 1...
2018-08-18 15:30:00
124
转载 LeetCode818. Race Car
https://leetcode.com/problems/race-car/description/Your car starts at position 0 and speed +1 on an infinite number line. (Your car can go into negative positions.)Your car drives automatica...
2018-08-17 01:03:00
127
转载 LeetCode解题报告—— Best Time to Buy and Sell Stock
Best Time to Buy and Sell StockSay you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete at mostt...
2018-08-15 01:33:00
96
转载 LeetCode218. The Skyline Problem
https://leetcode.com/problems/the-skyline-problem/description/A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now s...
2018-08-15 00:32:00
130
转载 LeetCode214. Shortest Palindrome
Given a strings, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can find by performing this transformation.Examp...
2018-08-14 14:28:00
93
转载 LeetCode212. Word Search II
https://leetcode.com/problems/word-search-ii/description/Given a 2D board and a list of words from the dictionary, find all words in the board.Each word must be constructed from letters of se...
2018-08-13 22:11:00
84
转载 LeetCode132. 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: 1E...
2018-08-13 02:40:00
93
转载 LeetCode239. Sliding Window Maximum
Given an arraynums, there is a sliding window of sizekwhich is moving from the very left of the array to the very right. You can only see theknumbers in the window. Each time the sliding win...
2018-08-13 02:25:00
98
转载 LeetCode解题报告—— Interleaving String
Givens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.Example 1:Input: s1 = "aabcc", s2 = "dbbca", s3 = "aadbbcbcac"Output: trueExample 2:Input: s1 = "aabcc", s...
2018-08-10 00:42:00
139
转载 LeetCode解题报告—— Maximal Rectangle
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.Example:Input:[ ["1","0","1","0","0"], ["1","0","1","1","1"], [...
2018-08-08 20:56:00
77
转载 LeetCode解题报告—— Minimum Window Substring && Largest Rectangle in Histogram
1.Minimum Window SubstringGiven 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).Example:Input: S = "ADOBECODEBANC", T ...
2018-08-08 01:40:00
82
转载 LeetCode解题报告—— N-Queens && Edit Distance
1. N-QueensThen-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return all distinct solutions to then-q...
2018-08-05 16:58:00
131
转载 LeetCode解题报告—— Trapping Rain Water
Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.The above elevation map is represented by a...
2018-08-05 15:06:00
117
转载 LeetCode解题报告—— Longest Valid Parentheses
Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.Example 1:Input: "(()"Output: 2Explanation: The longest...
2018-08-03 23:56:00
86
转载 LeetCode解题报告—— Reverse Nodes in k-Group && Sudoku Solver
1.Reverse Nodes in k-GroupGiven a linked list, reverse the nodes of a linked listkat a time and return its modified list.kis a positive integer and is less than or equal to the length of ...
2018-08-03 22:48:00
88
转载 LeetCode解题报告—— Regular Expression Matching
Given an input string (s) and a pattern (p), implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more of the preceding elem...
2018-07-31 16:27:00
106
转载 [编程题] 合唱团 && 地闹逃脱
1. 合唱团有 n 个学生站成一排,每个学生有一个能力值,牛牛想从这 n 个学生中按照顺序选取 k 名学生,要求相邻两个学生的位置编号的差不超过 d,使得这 k 个学生的能力值的乘积最大,你能返回最大的乘积吗?输入描述:每个输入包含 1 个测试用例。每个测试数据的第一行包含一个整数 n (1 <= n <= 50),表示学生的个数,接下来的一行,包含 n 个整数...
2018-07-31 16:16:00
97
转载 LeetCode解题报告—— Median of Two Sorted Arrays
There are two sorted arraysnums1andnums2of 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 = [...
2018-07-21 16:57:00
125
转载 LeetCode解题报告—— Bus Routes
We have a list of bus routes. Eachroutes[i]is a bus route that the i-th busrepeats forever. For example ifroutes[0] = [1, 5, 7], this means that the firstbus (0-th indexed) travels in the se...
2018-07-17 23:17:00
234
转载 LeetCode解题报告—— Number of Islands & Bitwise AND of Numbers Range
1.Number of IslandsGiven a 2d grid map of'1's (land) and'0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or...
2018-06-01 17:20:00
75
转载 LeetCode解题报告—— Linked List Cycle II & Reverse Words in a String & Fraction to Recurring Decimal...
1.Linked List Cycle IIGiven a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Note:Do not modify the linked list.思路:想法是利用两指针,一个每次移动一步,另一个每次移动两步,如果存在...
2018-05-25 01:24:00
129
转载 LeetCode解题报告—— Sum Root to Leaf Numbers & Surrounded Regions & Single Number II
1.Sum Root to Leaf NumbersGiven a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which represe...
2018-05-13 02:21:00
89
转载 LeetCode解题报告——Convert Sorted List to Binary Search Tree & Populating Next Right Pointers in Each Nod...
1.Convert Sorted List to Binary Search TreeGiven a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.For this problem, a height-balanced bi...
2018-04-23 14:22:00
101
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人