- 博客(10)
- 收藏
- 关注
原创 leetcode weekly test 146
5130. Number of Equivalent Domino PairsGiven a list of dominoes, dominoes[i] = [a, b] is equivalent to dominoes[j] = [c, d] if and only if either (ac and bd), or (ad and bc) - that is, one domino can...
2019-07-21 14:43:23 199
原创 Leetcode array Top Interview Questions 32道题总结
本篇文章是对leetcode array和Top Interview Questions标签下32道array类型题目的总结leetcode 283. Move Zeroes此题属于数组交换型,交换数组中元素的位置以满足某种条件解:交换数组位置,一般使用两个指针的办法,已到达O(1) space 的效果并且此题有个特殊之处,题目中将数组中的元素分为0项和非0项,也可分为数组分类型,数组分类...
2019-07-13 17:49:51 248
原创 leetcode 4. Median of Two Sorted Arrays
There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).You may assume nums1 and num...
2019-07-13 14:38:01 173
原创 leetcode 41. First Missing Positive
Given an unsorted integer array, find the smallest missing positive integer.Example 1:Input: [1,2,0]Output: 3Example 2:Input: [3,4,-1,1]Output: 2Example 3:Input: [7,8,9,11,12]Output: 1tag: a...
2019-07-13 14:35:57 110
原创 leetcode 84. Largest Rectangle in Histogram
Given n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.Example:Input: [2,1,5,6,2,3]Output: 10t...
2019-07-13 14:34:27 107
原创 leetcode 128. Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.Your algorithm should run in O(n) complexity.Example:Input: [100, 4, 200, 1, 3, 2]Output: 4Explan...
2019-07-13 14:31:59 142
原创 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.Example:Input: [0,1,0,2,1,0,1,3,2,1,2,1]Output:...
2019-07-13 14:30:44 142
原创 前缀树
https://www.cnblogs.com/luosongchao/p/3239521.htmlhttps://blog.csdn.net/u013949069/article/details/78056102开个坑,之后来填
2019-07-08 22:27:51 104
原创 leetcode Weekly Contest 144
rank:1313 / 3582pass: 3/41108. Defanging an IP AddressGiven a valid (IPv4) IP address, return a defanged version of that IP address.A defanged IP address replaces every period “.” with “[.]”.Exam...
2019-07-07 15:18:03 220
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人