Contains Duplicate 描述 分析 解法1 哈希表 解法2 排序 Contains Duplicate 描述 Given an array of integers, find if the array contains any duplicates. Your function should return true if a...
Longest Valid Parentheses 描述 分析 使用栈 Dynamic Programming, One Pass 两遍扫描 相关题目 Longest Valid Parentheses 描述 Given a string containing just the characters '(' and ')' , fi...
Rotate Array 描述 分析 解法1 三轮reverse Rotate Array 描述 Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3 , the array [1,2,3,4,5,6,7] ...
Sort Colors 描述 分析 代码1 代码2 代码3 相关题目 Sort Colors 描述 Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, w...
Subarray Sum Closest Question 题解 C++ 源码分析 复杂度分析 扩展 Subarray Sum Closest Question lintcode: (139) Subarray Sum Closest Given an integer array , find a subarray wit...