https://leetcode-cn.com/problems/lian-xu-zi-shu-zu-de-zui-da-he-lcof/ 1、题目描述: 输入一个整型数组,数组里有正数也有负数。数组中的一个或连续多个整数组成一个子数组。求所有子数组的和的最大值。 要求时间复杂度为O(n)。 2、示 ...
分类:
编程语言 时间:
2020-07-19 18:09:51
阅读次数:
388
package LeetCode_122 /** * 122. Best Time to Buy and Sell Stock II * https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/description/ * * ...
分类:
其他好文 时间:
2020-07-19 18:07:26
阅读次数:
79
问题描述 给定一个可包含重复数字的序列,返回所有不重复的全排列。 示例: 输入: [1,1,2]输出:[ [1,1,2], [1,2,1], [2,1,1]] 来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/permutations-ii 解答 ...
分类:
其他好文 时间:
2020-07-19 17:55:22
阅读次数:
60
给定一个整数 n,生成所有由 1 ... n 为节点所组成的 二叉搜索树 。 示例: 输入:3 输出: [ [1,null,3,2], [3,2,null,1], [3,1,null,null,2], [2,1,3], [1,null,2,null,3] ] 解释: 以上的输出对应以下 5 种不同结 ...
分类:
其他好文 时间:
2020-07-19 17:50:40
阅读次数:
72
给定一个含有数字和运算符的字符串,为表达式添加括号,改变其运算优先级以求出不同的结果。你需要给出所有可能的组合的结果。有效的运算符号包含 +, - 以及 * 。 示例 1: 输入: "2-1-1" 输出: [0, 2] 解释: ((2-1)-1) = 0 (2-(1-1)) = 2 示例 2: 输入 ...
分类:
其他好文 时间:
2020-07-19 16:31:26
阅读次数:
72
406. 根据身高重建队列 贪心算法 思路参考:https://leetcode-cn.com/problems/queue-reconstruction-by-height/solution/gen-ju-shen-gao-zhong-jian-dui-lie-by-leetcode/ 第一次在排 ...
分类:
其他好文 时间:
2020-07-19 15:49:30
阅读次数:
63
链接:https://leetcode-cn.com/problems/recover-binary-search-tree/ 代码 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode ...
分类:
其他好文 时间:
2020-07-19 11:36:41
阅读次数:
70
链接:https://leetcode-cn.com/problems/same-tree/ 代码 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode ...
分类:
其他好文 时间:
2020-07-19 11:33:58
阅读次数:
44
此博客链接: https://www.cnblogs.com/ping2yingshi/p/13337999.html 搜索插入位置 题目链接:https://leetcode-cn.com/problems/search-insert-position/submissions/ 给定一个排序数组和 ...
分类:
其他好文 时间:
2020-07-19 00:56:40
阅读次数:
101
package LeetCode_1507 import java.lang.StringBuilder /** * 1507. Reformat Date * https://leetcode.com/problems/reformat-date/description/ * * Given a ...
分类:
其他好文 时间:
2020-07-19 00:30:33
阅读次数:
69