Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
LeetCode218https://leetcode.com/problems/the-skyline-problem/ 12.RMQ AcWing1273https://www.acwing.com/problem/content/1275/ 2.数据结构 1.队列、单调队列(区间最值) LeetCode225https://leetcode.com/problems/implement-stack-using-queues/ LeetCode239https://leetcode.com/problems/sliding-window-max...
We can't remove them, because they might be needed later. This is the first challenge. The problem requests we find all possible solutions, that's the second challenge. It took me lots of time and efforts to put up a long and sloppy solution, which never got accepted. Here the solution...
53. 最大子数组和 - 给你一个整数数组 nums ,请你找出一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。 子数组 是数组中的一个连续部分。 示例 1: 输入:nums = [-2,1,-3,4,-1,2,1,-5,4] 输出:6 解释:连续子数组 [4,-1,2,1] 的和最大,为
请你设计并实现一个满足LRU (最近最少使用) 缓存约束的数据结构。 实现LRUCache类: LRUCache(int capacity)以正整数作为容量capacity初始化 LRU 缓存 int get(int key)如果关键字key存在于缓存中,则返回关键字的值,否则返回-1。 void put(int key, int value)如果关键字key已经存在,则变更其数据值value;如果...
leetcode problem 3sum 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 classSolution { public: vector<vector<int>> threeSum(vector<int>& nums) {...
Can you solve this real interview question? Pow(x, n) - Implement pow(x, n) [http://www.cplusplus.com/reference/valarray/pow/], which calculates x raised to the power n (i.e., xn). Example 1: Input: x = 2.00000, n = 10 Output: 1024.00000 Example
前缀和数组 303、304、238 题解 数组篇 二. 字符串 题目分类 题目编号 字符 520 回文串的定义 125 ...
website:https://leetcode.com/problemset/all/ username/password: yanyan314/ 314@leetcode leetcode刷题总结博客:https://blog.csdn.net/nettee?type=blog&year=2020&month=03answers:https://www.jiuzhang.cn/solution/intersection-of-two-arrays-ii/ ...
365 Water and Jug Problem Algorithms Medium 363 Max Sum of Rectangle No Larger Than K Algorithms Medium 357 Count Numbers with Unique Digits Algorithms Medium 355 Design Twitter design-twitter Algorithms Hard 354 Russian Doll Envelopes Algorithms Hard 352 Data Stream as Disjoint Intervals Algorithms Ha...