大体上,leetcode easy相当于codeforces800-1100,medium相当于1200-1500,而hard则相当于1600-2000,极...
假设你正在爬楼梯。需要 n 阶你才能到达楼顶。 每次你可以爬 1 或2 个台阶。你有多少种不同的方法可以爬到楼顶呢? 示例1: 输入:n = 2 输出:2 解释:有两种方法可以爬到楼顶。 1. 1 阶 + 1 阶 2. 2 阶 示例2: 输入:n = 3 输出:3 解释:有三种方法可以爬到楼顶。 1. 1 阶 + 1 阶 + 1 ...
给你一个整数数组nums,请你找出一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。 是数组中的一个连续部分。 示例1: 输入:nums = [-2,1,-3,4,-1,2,1,-5,4]输出:6解释:连续子数组 [4,-1,2,1] 的和最大,为 6 。
比如有最经典的sliding window模式,Two pointers模式,快慢指针模式,合并intervals模式,cyclic sort模式,in-place翻转链表模式,树上的BFS,树上的DFS,双Heaps模式,subsets模式,二分法变种,Top K模式,多路模式(K-ways),0/1背包,拓扑排序。 需要的小伙伴就去来一波吧! 他家最最出名的还是这门Grokking the System Desig...
62Unique Paths](https://leetcode.com/problems/unique-paths/)MediumSolution.java 64Minimum Path Sum](https://leetcode.com/problems/minimum-path-sum/)MediumSolution.java 70Climbing StairsEasySolution.java 72Edit DistanceMediumSolution.java 73Set Matrix ZeroesMediumSolution.java ...
Provide all my solutions and explanations in Chinese for all the Leetcode coding problems. Same as this: LeetCode All in One 题目讲解汇总(持续更新中...) Click below image to watch YouTube Video Note: All explanations are written in Github Issues, please do not create any new issue or ...
【题目】Given an m x n matrix of non-negative integers representing the height of each unit cell in a continent, the “Pacific ocean” touches the left and top edges of the matrix and the “Atlantic ocean” touches the right and bottom edges. Water can only flow in four directions ...
脚撕LeetCode(196Sql)Easy 题目地址:https://leetcode-cn.com/problems/delete-duplicate-emails/ 编写一个 SQL 查询,来删除Person表中所有重复的电子邮箱,重复的邮箱里只保留Id最小的那个。 代码语言:javascript 复制 +---+---+|Id|Email|+---+---+|1|john@example.com||2|bob@example.com||3|john...
https://leetcode.com/problems/swim-in-rising-water/discuss/113743/JAVA-DP-+-DFS https://leetcode.com/problems/swim-in-rising-water/discuss/113765/Easy-and-Concise-Solution-using-Binary-Search-PythonC++ https://leetcode.com/problems/swim-in-rising-water/discuss/113758/C++-two-solutions-Binary-...
题目难度:Easy 通过率:70.20% 相关话题 数学 https:///tag/math 相似题目 完美数 https:///problems/perfect-number/难度:简单 解题思路: 设计一个判断单个数是否是自除数的函数,比如取名为IsSelfDIv() IsSelfDIv函数的要点是: 排除数位中含有0的数