![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
Adonis-Stan
啊~
展开
-
LeetCode -- 31. Next Permutation(下一个排列)
文章目录原文原文Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest...原创 2019-04-10 22:55:30 · 142 阅读 · 0 评论 -
LeetCode -- 53. Maximum Subarray(最大子数组)
文章目录1. 原文2. 翻译3. 分析3.1. 普通法3.2. 动态规划法(DP)3.3. 分治递归(divide and conquer approach)4. AC代码4.1. 普通法4.2. DP4.3. 分治递归1. 原文Given an integer array nums, find the contiguous subarray (containing at least one...原创 2019-04-11 15:58:35 · 230 阅读 · 0 评论 -
LeetCode -- 108. Convert Sorted Array to Binary Search Tree(将有序数组转换为二叉搜索树)
文章目录一、原文二、翻译三、分析四、AC代码一、原文Given an array where elements are sorted in ascending order, convert it to a height balanced BST.For this problem, a height-balanced binary tree is defined as a binary tr...原创 2019-04-15 19:41:00 · 140 阅读 · 0 评论 -
LeetCode -- 130. Surrounded Regions(周边区域)
文章目录一、原文二、翻译三、分析四、AC代码4.1. 代码14.2. 代码2一、原文Given a 2D board containing ‘X’ and ‘O’ (the letter O), capture all regions surrounded by ‘X’.A region is captured by flipping all 'O’s into 'X’s in that ...原创 2019-04-26 23:08:17 · 181 阅读 · 0 评论 -
LeetCode -- 207. Course Schedule(课程计划)
文章目录一、原文二、翻译三、分析3.1 利用拓扑排序3.2 DFS四、AC代码4.1 利用拓扑排序4.2 DFS一、原文There are a total of n courses you have to take, labeled from 0 to n-1.Some courses may have prerequisites, for example to take course 0...原创 2019-04-30 10:58:18 · 137 阅读 · 0 评论 -
LeetCode -- 279. Perfect Squares(完美平方)
文章目录一、原文二、翻译三、分析3.1 BFS3.2 DP四、AC代码4.1 BFS代码4.2 DP代码一、原文Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, …) which sum to n.Example 1:Input: ...原创 2019-05-08 16:03:04 · 197 阅读 · 0 评论