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...
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...
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...
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...
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...
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...
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...
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...
一些相似单词的区别之处 1. devote 和 contribute https://zhidao.baidu.com/question/328034454447561365.html contribute to 和devote to区别1、devote to:专心致力于,把…专用于,另外还有听任的意思。2、contribute to:捐助,帮助,贡献,出力;给…投稿的意思。3、contribute (mo...
新单词和语法的学习(英文) 1. 习惯于 be used to be accustomed to eg:I'musedtoloneliness. / 我已习惯孤独 Heisaccustomedtohardwork. / 他习惯艰苦工作 Sheusedtomakeaspeechinpublic. / 她过去习惯于在大众下发表演讲。 注意这里的 us...
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...
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...
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...
算法刷题细节点总结 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...
LeetCode解题报告—— Best Time to Buy and Sell Stock Best Time to Buy and Sell Stock Say 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...
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 ...
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...
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...
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: 1 E...
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...