摘要: Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Note: The input array will only contain 0 and 1.The length o 阅读全文
posted @ 2017-02-17 17:53 细雨落花 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Given an array of integers where 阅读全文
posted @ 2017-02-17 16:37 细雨落花 阅读(284) 评论(0) 推荐(0) 编辑
摘要: 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, giv 阅读全文
posted @ 2017-02-17 12:06 细雨落花 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 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, 阅读全文
posted @ 2017-02-17 11:21 细雨落花 阅读(138) 评论(0) 推荐(0) 编辑