上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 27 下一页
摘要: 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 阅读全文
posted @ 2017-09-21 01:16 Jimmy_Cheng 阅读(311) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n] 阅读全文
posted @ 2017-09-21 00:57 Jimmy_Cheng 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twi 阅读全文
posted @ 2017-09-20 07:44 Jimmy_Cheng 阅读(308) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexi 阅读全文
posted @ 2017-09-20 04:30 Jimmy_Cheng 阅读(275) 评论(0) 推荐(0) 编辑
摘要: Design a data structure that supports all following operations in average O(1) time. Note: Duplicate elements are allowed. insert(val): Inserts an ite 阅读全文
posted @ 2017-09-20 02:31 Jimmy_Cheng 阅读(265) 评论(0) 推荐(0) 编辑
摘要: Design a data structure that supports all following operations in average O(1) time. insert(val): Inserts an item val to the set if not already presen 阅读全文
posted @ 2017-09-17 10:52 Jimmy_Cheng 阅读(360) 评论(0) 推荐(0) 编辑
摘要: Assume you have an array of length n initialized with all 0's and are given k update operations. Each operation is represented as a triplet: [startInd 阅读全文
posted @ 2017-09-17 07:24 Jimmy_Cheng 阅读(402) 评论(0) 推荐(0) 编辑
摘要: According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John 阅读全文
posted @ 2017-09-16 09:57 Jimmy_Cheng 阅读(2231) 评论(0) 推荐(0) 编辑
摘要: Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. 阅读全文
posted @ 2017-09-14 11:48 Jimmy_Cheng 阅读(1459) 评论(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-09-11 04:39 Jimmy_Cheng 阅读(200) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 27 下一页