海量技术面试题库,拥有算法、数据结构、系统设计等 1000+题目,帮助你高效提升编程技能,轻松拿下世界 IT 名企 Dream Offer。
53. 最大子数组和 - 给你一个整数数组 nums ,请你找出一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。 子数组 是数组中的一个连续部分。 示例 1: 输入:nums = [-2,1,-3,4,-1,2,1,-5,4] 输出:6 解释:连续子数组 [4,-1,2,1] 的和最大,为
FindTabBarSize FindBorderBarSize 请你设计并实现一个满足LRU (最近最少使用) 缓存约束的数据结构。 实现LRUCache类: LRUCache(int capacity)以正整数作为容量capacity初始化 LRU 缓存 int get(int key)如果关键字key存在于缓存中,则返回关键字的值,否则返回-1。 void put(int key, int value)如果关键字key已...
leetcode-cn.com/problem Given a string s, find the longest palindromic subsequence's length in s. A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements. 给你一个字符串 s ,找出其中最长的回文...
- 穷码农的回答 - 知乎. DP is always a very difficult problem for me and lately, I have done dozens of questions to improve my DP skills. But the DP problem is so flexible that random practice has little effect. Therefore, I made further improvements based on these two articles and summa...
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
testHead=testHead.next; } }if(!valid){break; }if(pre ==null){ pre=testHead; ret=pre; }else{ pre.next=testHead; } ListNode oldPre=current; ListNode next=current.next; current.next=testHead.next; pre=current; current=next;for(inti = 1; i < k; ++i){ ...
509 斐波那契数 LeetCode-Python-513. 找树左下角的值 513 找树左下角的值 LeetCode-Python-515. 在每个树行中找最大值 515 在每个树行中找最大值 LeetCode-Python-520. 检测大写字母 520 检测大写字母 LeetCode-Python-529. 扫雷游戏 529 扫雷游戏 LeetCode-Python-530. 二叉搜索树的最小绝对差 530 ...
For the purpose of this problem, assume that your function returns 0 when the reversed integer overflows. 32 : 32 [−2^31, 2^31 − 1] 0 10 190 [−2^31, 2^31 − 1] 0 package leetcode func reverse7(x int) int { tmp := 0 for x != 0 { tmp = tmp*10 + x%10 x...
136、137、260、268与或非的应用 371、318、201十三. 动态规划题目分类 题目编号数组中的动态规划 509...