上一页 1 2 3 4 5 6 7 8 ··· 11 下一页
摘要: Majority Element II Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Note: The algorithm should run in linear 阅读全文
posted @ 2020-07-21 09:53 十三w~w 阅读(93) 评论(0) 推荐(0) 编辑
摘要: Summary Ranges Given a sorted integer array without duplicates, return the summary of its ranges. Example 1: Input: [0,1,2,4,5,7] Output: ["0->2","4-> 阅读全文
posted @ 2020-07-20 15:24 十三w~w 阅读(80) 评论(0) 推荐(0) 编辑
摘要: Basic Calculator Implement a basic calculator to evaluate a simple expression string. The expression string may contain open ( and closing parentheses 阅读全文
posted @ 2020-07-20 15:18 十三w~w 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Rectangle Area Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectangle is defined by its bottom left corner and top ri 阅读全文
posted @ 2020-07-20 14:45 十三w~w 阅读(101) 评论(0) 推荐(0) 编辑
摘要: Count Complete Tree Nodes Given a complete binary tree, count the number of nodes. Note: Definition of a complete binary tree from Wikipedia: In a com 阅读全文
posted @ 2020-07-20 14:15 十三w~w 阅读(88) 评论(0) 推荐(0) 编辑
摘要: Maximal Square Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. Example: Input: 1 0 阅读全文
posted @ 2020-07-18 17:29 十三w~w 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Combination Sum III Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each co 阅读全文
posted @ 2020-07-18 15:42 十三w~w 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 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 th 阅读全文
posted @ 2020-07-18 15:08 十三w~w 阅读(89) 评论(0) 推荐(0) 编辑
摘要: House Robber II You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at t 阅读全文
posted @ 2020-07-17 21:32 十三w~w 阅读(115) 评论(0) 推荐(0) 编辑
摘要: LeetCode中出现了2sum, 3sum, 4sum的问题,文章给出了一种通用的解法,想法是将n_sum问题转换为(n-1)_sum问题,具体步骤如下: 定义函数sum(n, target),表示求解和为target的nsum问题 step1:排序,这样2sum问题可以用双指针解决,时间复杂度为 阅读全文
posted @ 2020-07-17 13:01 十三w~w 阅读(297) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 11 下一页