LeetCode
码不停题
卢克飞
Don't aim for success if you really want it,just stick to what you love and believe in,it will come naturally .
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【LeetCode5】最长回文子串
LC5.Longest Palindromic Substring Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Input: "babad" Output: "bab" Note: &am原创 2019-02-18 13:51:30 · 255 阅读 · 0 评论 -
旋转图像
旋转图像 给定一个 n × n 的二维矩阵表示一个图像。 将图像顺时针旋转 90 度。 说明: 你必须在原地旋转图像,这意味着你需要直接修改输入的二维矩阵。请不要使用另一个矩阵来旋转图像。 Example 1: Given input matrix = [ [1,2,3], [4,5,6], [7,8,9] ], rotate the input matrix in-place such th...转载 2018-10-23 00:14:31 · 162 阅读 · 0 评论 -
【LeetCode 108】将有序数组转换为二叉搜索树
将一个按照升序排列的有序数组,转换为一棵高度平衡二叉搜索树。 本题中,一个高度平衡二叉树是指一个二叉树每个节点 的左右两个子树的高度差的绝对值不超过 1。 示例: 给定有序数组: [-10,-3,0,5,9], 一个可能的答案是:[0,-3,9,-10,null,5],它可以表示下面这个高度平衡二叉搜索树: 0 / -3 9 / / -10 5 注意:一个有序数组可以组成多种形状的...原创 2018-11-15 21:06:53 · 265 阅读 · 0 评论 -
【LeetCode 96】Unique Binary Search Trees
Given n, how many structurally unique BST’s (binary search trees) that store values 1 … n? Example: Input: 3 Output: 5 Explanation: Given n = 3, there are a total of 5 unique BST's: 1 3 ...原创 2019-01-24 15:57:24 · 153 阅读 · 0 评论 -
【LeetCode】84. Largest Rectangle in Histogram
题目描述 给定 n 个非负整数,用来表示柱状图中各个柱子的高度。每个柱子彼此相邻,且宽度为 1 。 求在该柱状图中,能够勾勒出来的矩形的最大面积。 以上是柱状图的示例,其中每个柱子的宽度为 1,给定的高度为 [2,1,5,6,2,3]。 图中阴影部分为所能勾勒出的最大矩形面积,其面积为 10 个单位。 示例: 输入: [2,1,5,6,2,3] 输出: 10 ...原创 2018-12-29 14:54:03 · 363 阅读 · 0 评论
分享