最新 最热

Leetcode 153 Find Minimum in Rotated Sorted Array

Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Find the minimum element. You ...

2018-01-12
1

Leetcode 162 Find Peak Element

A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and return its index. The ...

2018-01-12
0

Leetcode 188 Best Time to Buy and Sell Stock IV

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 at mo...

2018-01-12
1

Leetcode 217. Contains Duplicate

Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and i...

2018-01-12
1

Leetcode 215. Kth Largest Element in an Array

Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For example, Gi...

2018-01-12
1

LWC 51:684. Redundant Connection

该文讲述了如何检测并删除树中冗余的边,以保证树的连通性。首先介绍了并查集,用于检查节点是否属于同一个连通块;然后讲述了如何通过并查集检测冗余边,并返回最后出现在2D数组中的边,保证至少存在一条有效边。...

2018-01-02
1

LWC 61:739. Daily Temperatures

该文介绍了计算给定温度列表中每个元素下一天的最高温度的问题。通过使用栈和记忆化搜索算法,该文给出了一个高效的解决方案。

2018-01-02
1