LeetCode 155最小栈: 无额外占用空间-储存差值 |Min Stack with No extra space-Store as Difference 目录 Problem description Normal method No extra space approach Problem description Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. TheMinStackclass: M...
// Solution 1: An interesting problem. As the elements are all integers, if not encountering 0, the absolute value of the product will continue to increase. Thus the product is either min or max. By keeping watch over both ends, we have the maximum product of subarrays. This holds only...
优先从剑指offer开始刷,每天刷个一两道。剑指offerleetcode-cn.com/problem。我是按照标准告诉你的应该刷的题,但是你时间可能不允许,那就是按照我说的顺序,你能刷多少刷多少。 刷几遍刷题肯定刷越多越好,至少也得刷明白了一百道。至于几遍有的人一遍就懂,那就一遍,不行就两遍呗。没什么固定说法。第...
1. 两数之和 - 给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 target 的那 两个 整数,并返回它们的数组下标。 你可以假设每种输入只会对应一个答案,并且你不能使用两次相同的元素。 你可以按任意顺序返回答案。 示例 1: 输入
218.The-Skyline-Problem (H) 2158.Amount-of-New-Area-Painted-Each-Day (H-) 2237.Count-Positions-on-Street-With-Required-Brightness (M) 2251.Number-of-Flowers-in-Full-Bloom (M) 2327.Number-of-People-Aware-of-a-Secret (H-) 2381.Shifting-Letters-II (M) 2584.Split-the-Array-to-Make...
刷完这道题就可以试试力扣的No674.最长连续递增序列,类型基本差不多。一刷执行耗时beat 98.68% 内存...
Note: All explanations are written in Github Issues, please do not create any new issue or pull request in this project since the problem index should be consistent with the issue index, thanks! ('$' means the problem is locked on Leetcode, '*' means the problem is related to Database...
218 The Skyline Problem 25.5% Hard 465 opt imal Account Balancing 29.9% Hard 345 Reverse Vowels of a String 37.3% Easy 56 Merge Intervals 28.3% Hard 297 Serialize and Deserialize Binary Tree 31.5% Hard 407 Trapping Rain Water II 35.5% Hard ...
365 Water and Jug Problem 20.10% Medium 364 Nested List Weight Sum II $ 47.20% Medium 363 Max Sum of Rectangle No Larger Than K 27.00% Hard 362 Design Hit Counter $ 48.30% Medium 361 Bomb Enemy $ 32.60% Medium 360 Sort Transformed Array $ 40.80% Medium 359 Logger Rate Limiter $ 56.00...
LeetCode Problem No.3 Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3....