![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode题目解析
文章平均质量分 79
kaby2011
这个作者很懒,什么都没留下…
展开
-
LeetCode——122. Best Time to Buy and Sell Stock II
题目:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie,原创 2017-08-01 17:34:02 · 183 阅读 · 0 评论 -
LeetCode——136. Single Number
题目:Given an array of integers, every element appears twiceexcept for one. Find that single one.Note: Your algorithm should have a linear runtime complexity. Could you implement it without原创 2017-08-02 20:20:36 · 258 阅读 · 0 评论 -
LeetCode--137. Single Number II && 260. Single Number III之暴力搜法
137. Single Number II 题目:Given an array of integers, every element appears three times except for one, which appears exactly once. Find that single one.Note:Your algorithm should have a li原创 2017-08-03 16:51:05 · 234 阅读 · 0 评论 -
leetcode--141. Linked List Cycle&&142. Linked List Cycle II
141. Linked List Cycle题目:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?分析:要确定一个链表中是否有环,设置两个指针,一个fast,一个慢slow,如果fast和slow相遇则证明有原创 2017-08-05 16:59:11 · 183 阅读 · 0 评论 -
LeetCode--150. Evaluate Reverse Polish Notation
题目:Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["原创 2017-08-08 18:05:17 · 179 阅读 · 0 评论 -
leetcode --20. Valid Parentheses
题目:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are原创 2017-08-11 10:34:09 · 156 阅读 · 0 评论 -
leetcode--42. Trapping Rain Water
题目:Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,1,3,2原创 2017-08-11 11:32:51 · 162 阅读 · 0 评论 -
leetcode--32.longest-valid-parentheses
题目:Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest valid parentheses substring is"(原创 2017-08-15 17:08:03 · 199 阅读 · 0 评论 -
leetcode--84. Largest Rectangle in Histogram
题目:分析:代码:原创 2017-08-15 17:32:17 · 156 阅读 · 0 评论 -
leetcode--3,Longest Substring Without Repeating Characters &&53. Maximum Subarray&&String.valueOf()
3,Longest Substring Without Repeating Characters题目:Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc",原创 2017-08-23 15:50:57 · 180 阅读 · 0 评论