leetcode
一只吃猫的鱼
这个作者很懒,什么都没留下…
展开
-
leetcode-26
题目 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 space for another array, you must do this in place原创 2017-07-13 10:03:57 · 164 阅读 · 0 评论 -
leetcode-283
Move Zeroes 题目 Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, given nums = [0, 1, 0, 3, 12], a原创 2017-07-17 14:10:24 · 718 阅读 · 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 n原创 2017-07-17 13:28:37 · 203 阅读 · 0 评论 -
leetcode-122
Best Time to Buy and Sell Stock II 题目 Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete as原创 2017-07-17 10:08:08 · 367 阅读 · 0 评论 -
leetcode-121
Best Time to Buy and Sell Stock 题目 Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy原创 2017-07-14 17:18:29 · 192 阅读 · 0 评论 -
leetcode-88
Merge Sorted Array 题目 Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: You may assume that nums1 has enough space (size that is greater or equ原创 2017-07-14 10:10:54 · 329 阅读 · 0 评论 -
leetcode-53
Maximum Subarray 题目 Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,1,-3,4,-1,2,1,-5,4], the contiguou原创 2017-07-13 13:39:45 · 178 阅读 · 0 评论 -
leetcode-35
Search Insert Position 题目 Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assum原创 2017-07-13 11:02:51 · 154 阅读 · 0 评论 -
leetcode-27
Remove Element 题目 Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another array, you must do this in place wi原创 2017-07-13 10:32:31 · 113 阅读 · 0 评论 -
leetcode-268
Missing Number 题目 Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example, Given nums = [0, 1, 3] return 2. Note: Yo原创 2017-07-17 15:50:37 · 193 阅读 · 0 评论