Leetcode
文章平均质量分 66
iteye_9238
这个作者很懒,什么都没留下…
展开
-
Leetcode-189-Rotate Array
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] is rotated to [5,6,7,1,2,3,4].Note:Try to come up as many soluti...原创 2015-08-25 15:25:35 · 83 阅读 · 0 评论 -
LeetCode-209-Minimum Size Subarray Sum
Minimum Size Subarray Sum 来自 <https://leetcode.com/problems/minimum-size-subarray-sum/> Given an array of n positive integers and a positive integer s, find the minimal length of a subar...原创 2015-08-27 14:28:22 · 115 阅读 · 0 评论 -
LeetCode-15-3Sum*
3Sum 来自 <https://leetcode.com/problems/3sum/> Given 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 wh...2015-08-27 20:53:03 · 92 阅读 · 0 评论 -
LeetCode-79-Word Search*
Word Search 来自 <https://leetcode.com/problems/word-search/> Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of ...原创 2015-08-29 11:15:51 · 91 阅读 · 0 评论 -
LeetCode-62-Unique Paths*(动态规划)
Unique Paths 来自 <https://leetcode.com/problems/unique-paths/> A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move...原创 2015-08-29 20:22:23 · 101 阅读 · 0 评论 -
LeetCode-35-Search Insert Position
Search Insert Position 来自 <https://leetcode.com/problems/search-insert-position/> Given a sorted array and a target value, return the index if the target is found. If not, return the inde...原创 2015-08-30 09:23:11 · 92 阅读 · 0 评论 -
LeetCode-73-Set Matrix Zeroes
Matrix Zeroes 来自 <https://leetcode.com/problems/set-matrix-zeroes/> Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up...原创 2015-08-30 13:56:44 · 91 阅读 · 0 评论 -
LeetCode-34-Search for a Range
Search for a Range 来自 <https://leetcode.com/problems/search-for-a-range/> Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm...2015-08-31 08:45:15 · 103 阅读 · 0 评论 -
LeetCode-74-Search a 2D Matrix
Search a 2D Matrix 来自 <https://leetcode.com/problems/search-a-2d-matrix/> Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properti...2015-09-07 20:24:24 · 94 阅读 · 0 评论 -
LeetCode-48-Rotate Image
Rotate Image 来自 <https://leetcode.com/problems/rotate-image/> You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could y...2015-09-07 21:30:51 · 77 阅读 · 0 评论 -
Leetcode-217-Contains Duplicate
Contains Duplicate来自 <https://leetcode.com/problems/contains-duplicate/> Given an array of integers, find if the array contains any duplicates. Your function should return true if any valu...原创 2015-08-27 08:41:21 · 99 阅读 · 0 评论 -
Leetcode-219-Contains Duplicate II
Contains Duplicate II来自 <https://leetcode.com/problems/contains-duplicate-ii/> Given an array of integers and an integer k, find out whether there are two distinct indices i and j in th...原创 2015-08-27 08:40:25 · 91 阅读 · 0 评论 -
Leetcode-27-Remove Element
Remove Element Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond th...原创 2015-08-25 20:52:32 · 63 阅读 · 0 评论 -
Leetcode-26-Remove Duplicates from Sorted Array
Remove Duplicates from Sorted Array Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra spa...原创 2015-08-25 23:21:50 · 70 阅读 · 0 评论 -
Leetcode-80-Remove Duplicates from Sorted Array II
Remove Duplicates from Sorted Array II 来自 <https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/> Follow up for "Remove Duplicates": What if duplicates are...原创 2015-08-25 23:36:54 · 98 阅读 · 0 评论 -
Leetcode-66-Plus One
Plus One 来自 <https://leetcode.com/problems/plus-one/> Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most sig...原创 2015-08-26 08:30:28 · 82 阅读 · 0 评论 -
Leetcode-118-Pascal's Triangle
Pascal's Triangle 来自 <https://leetcode.com/problems/pascals-triangle/> Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1]...原创 2015-08-26 08:51:18 · 70 阅读 · 0 评论 -
Leetcode-119-Pascal's Triangle II
Pascal's Triangle II 来自 <https://leetcode.com/problems/pascals-triangle-ii/> Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1]...原创 2015-08-26 09:27:47 · 99 阅读 · 0 评论 -
Leetcode-88-Merge Sorted Array
Merge Sorted Array 来自 <https://leetcode.com/problems/merge-sorted-array/> Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may a...2015-08-26 10:04:15 · 73 阅读 · 0 评论 -
Leetcode-169-Majority Element
Majority Element 来自 <https://leetcode.com/problems/majority-element/> Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊...原创 2015-08-26 14:53:16 · 70 阅读 · 0 评论 -
Leetcode-228-Summary Ranges
Summary Ranges 来自 <https://leetcode.com/problems/summary-ranges/> Given a sorted integer array without duplicates, return the summary of its ranges.For example, given [0,1,2,4,5,7], re...原创 2015-08-27 08:38:48 · 82 阅读 · 0 评论 -
LeetCode-63-Unique Paths II
Unique Paths II 来自 <https://leetcode.com/problems/unique-paths-ii/> Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths w...2015-09-14 11:04:19 · 86 阅读 · 0 评论