刘猿猿
刘猿猿
全部文章
LeetCode
ActiveMQ(1)
C++(11)
C语言(31)
git(3)
java(13)
LintCode(1)
Linux(28)
nowcoder(17)
Spring(5)
SQL(2)
剑指offer(23)
数据结构(6)
未归档(6)
程序人生(3)
算法(4)
归档
标签
去牛客网
登录
/
注册
刘猿猿的博客
全部文章
/ LeetCode
(共26篇)
20.有效的括号
题目描述 给定一个只包括 '(',')','{','}','[',']' 的字符串,判断字符串是否有效。 有效字符串需满足: 1.左括号必须用相同类型的右括号闭合。 2.左括号必须以正确的顺序闭合。 注意空字符串可被认为是有效字符串。 示例 1: 输入: “()” 输出: true...
2019-02-13
0
417
42.Trapping Rain Water(接雨水 ①)
题目描述 给定 n 个非负整数表示每个宽度为 1 的柱子的高度图,计算按此排列的柱子,下雨之后能接多少雨水。 上面是由数组 [0,1,0,2,1,0,1,3,2,1,2,1] 表示的高度图,在这种情况下,可以接 6 个单位的雨水(蓝色部分表示雨水)。 感谢 Marcos 贡献此图。 示例:...
vector
2019-02-12
0
468
15.threeSum
问题 Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives t...
2018-09-27
0
436
80.RemoveDuplicates II
问题 Follow up for "Remove Duplicates": What if duplicates are allowed at most twice? For example, Given sorted array nums = [1,1,1,2,2,...
2018-09-18
0
489
26.RemoveDuplicates I
问题 Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra...
Array
2018-09-18
0
424
最大获利
问题 给定一个数组,它的第 i 个元素是一支给定股票第 i 天的价格。 如果你最多只允许完成一笔交易(即买入和卖出一支股票),设计一个算法来计算你所能获取的最大利润。 注意你不能在买入股票前卖出股票。 示例 1: 输入: [7,1,5,3,6,4] 输出: 5 解释: 在第 2 天(股票...
2018-09-12
0
365
首页
上一页
1
2
3
下一页
末页