![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode/Array
文章平均质量分 74
Alatebloomer
这个作者很懒,什么都没留下…
展开
-
leetcode-7. Reverse Integer
7.Reverse IntegerGiven a signed 32-bit integerx, returnxwith its digits reversed. If reversingxcauses the value to go outside the signed 32-bit integer range[-231, 231- 1], then return0.Assume the environment does not allow you to store 64-bit...原创 2021-02-14 17:24:55 · 159 阅读 · 0 评论 -
leettcode-27. Remove Element
题目描述给出四堆石子,石子数分别为a,b,c,d。规定每次只能从堆顶取走石子,问取走所有石子的方案数。输入描述:在一行内读入四个由空格分隔的整数a,b,c,d, 输入均为不超过500的正整数输出描述:输出一个整数表示答案,答案对109+7取模示例1输入复制3 5 4 2输出复制2522520...原创 2021-02-06 22:54:02 · 75 阅读 · 0 评论 -
LeetCode-41. First Missing Positive(第一个丢失的正整数)
LeetCode-41. First Missing PositiveGiven 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:...原创 2018-04-23 20:47:47 · 141 阅读 · 0 评论 -
LeetCode-34. Search for a Range
LeetCode-34. Search for a RangeGiven an array of integers nums sorted in ascending order, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in t...原创 2018-04-18 16:10:44 · 115 阅读 · 0 评论 -
LeetCode-33. Search in Rotated Sorted Array
LeetCode-33. Search in Rotated Sorted ArraySuppose an array sorted in ascending order 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]).You are gi...原创 2018-04-18 13:16:52 · 116 阅读 · 0 评论 -
LeetCode-26. Remove Duplicates from Sorted Array(从排序数组中移除重复数字)
LeetCode-26. Remove Duplicates from Sorted ArrayGiven a sorted array, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for a...原创 2018-04-03 23:40:35 · 128 阅读 · 0 评论 -
LeetCode-15. 3Sum
LeetCode-15. 3SumGiven an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: The solution set must ...原创 2018-04-03 21:39:54 · 150 阅读 · 0 评论 -
LeetCode-11. Container With Most Water
LeetCode-11. Container With Most WaterGiven n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line...原创 2018-03-21 17:09:57 · 192 阅读 · 0 评论 -
LeetCode-4. Median of Two Sorted Arrays
LeetCode-4. Median of Two Sorted ArraysThere 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(lo...原创 2018-02-28 13:27:55 · 135 阅读 · 0 评论 -
leetcode-1.two sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the sam原创 2018-01-27 17:56:42 · 206 阅读 · 0 评论