Leetcode
卢克飞
Don't aim for success if you really want it,just stick to what you love and believe in,it will come naturally .
展开
-
旋转图像
旋转图像给定一个 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 · 93 阅读 · 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 · 186 阅读 · 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: 3Output: 5Explanation:Given n = 3, there are a total of 5 unique BST's: 1 3 ...原创 2019-01-24 15:57:24 · 92 阅读 · 0 评论 -
【LeetCode5】最长回文子串
LC5.Longest Palindromic SubstringGiven 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 · 147 阅读 · 0 评论