- 博客(5)
- 收藏
- 关注
原创 209. Minimum Size Subarray Sum
Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there isn’t one, return 0 instead. For example, given the array
2017-01-21 20:48:57 193
原创 169. Majority Element
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the array is non-empty and the majority element always
2017-01-20 21:49:39 227
原创 485. Max Consecutive Ones
Given a binary array, find the maximum number of consecutive 1s in this array.Example 1: Input: [1,1,0,1,1,1] Output: 3 Explanation: The first two digits or the last three digits are consecutiv
2017-01-18 23:15:21 267
原创 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], after calling your fu
2017-01-18 20:17:49 251
原创 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.Example: Given nums = [2, 7, 1
2017-01-18 17:11:48 239
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人