leetcode
文章平均质量分 52
Grenade_35
这个作者很懒,什么都没留下…
展开
-
leetcode--485. Max Consecutive Ones
Input: [1,1,0,1,1,1]Output: 3Explanation: The first two digits or the last three digits are consecutive 1s. The maximum number of consecutive 1s is 3.SOLUTION:#include #include using names原创 2017-02-25 17:32:08 · 191 阅读 · 0 评论 -
leetcode 167. Two Sum II - Input array is sorted
题目:Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the t原创 2017-03-04 13:57:38 · 153 阅读 · 0 评论 -
leetcode--53. Maximum Subarray
Question: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 contiguous subarra原创 2017-03-19 12:05:49 · 187 阅读 · 0 评论 -
leetcode--169. Majority Element
Question: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 majo原创 2017-03-13 00:16:46 · 168 阅读 · 0 评论 -
leetcode 66. Plus One
Question:Given a non-negative integer represented as a non-empty array of digits, plus one to the integer.You may assume the integer do not contain any leading zero, except the number 0 itself原创 2017-04-10 13:39:32 · 219 阅读 · 0 评论 -
leetcode 515. Find Largest Value in Each Tree Row
Question:You need to find the largest value in each row of a binary tree.Example:Input: 1 / \ 3 2 / \ \ 5 3 9 Output: [1, 3, 9]原创 2017-04-11 16:36:46 · 224 阅读 · 0 评论 -
leetcode----242. Valid Anagram
Question:Given two strings s and t, write a function to determine if t is an anagram of s.For example,s = "anagram", t = "nagaram", return true.s = "rat", t = "car", return false.Not原创 2017-04-23 17:23:34 · 189 阅读 · 0 评论 -
leetcode--523. Continuous Subarray Sum
Question: Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that sums up to the multiple of k, th原创 2017-05-22 19:12:40 · 286 阅读 · 0 评论