上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 27 下一页
摘要: Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3].... For example, given nums = [3, 5, 2, 1, 6, 4], 阅读全文
posted @ 2017-09-11 01:58 Jimmy_Cheng 阅读(281) 评论(0) 推荐(0) 编辑
摘要: Suppose you are at a party with n people (labeled from 0 to n - 1) and among them, there may exist one celebrity. The definition of a celebrity is tha 阅读全文
posted @ 2017-09-10 09:54 Jimmy_Cheng 阅读(893) 评论(0) 推荐(1) 编辑
摘要: 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-09-09 11:39 Jimmy_Cheng 阅读(238) 评论(0) 推荐(0) 编辑
摘要: Given an array of n integers nums and a target, find the number of index triplets i, j, k with 0 <= i < j < k < n that satisfy the condition nums[i] + 阅读全文
posted @ 2017-09-09 07:33 Jimmy_Cheng 阅读(440) 评论(0) 推荐(0) 编辑
摘要: This is a follow up of Shortest Word Distance. The only difference is now word1 could be the same as word2. Given a list of words and two words word1  阅读全文
posted @ 2017-09-09 05:01 Jimmy_Cheng 阅读(516) 评论(0) 推荐(0) 编辑
摘要: Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list. For example,Assume that words = 阅读全文
posted @ 2017-09-09 03:35 Jimmy_Cheng 阅读(298) 评论(0) 推荐(0) 编辑
摘要: Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except  阅读全文
posted @ 2017-09-08 09:08 Jimmy_Cheng 阅读(269) 评论(0) 推荐(0) 编辑
摘要: Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space. 题目 阅读全文
posted @ 2017-09-08 07:10 Jimmy_Cheng 阅读(223) 评论(0) 推荐(0) 编辑
摘要: Given a sorted integer array without duplicates, return the summary of its ranges. Example 1: Example 2: 题目标签:Array 题目给了我们一个nums array, 让我们找出它的区间总结。 这 阅读全文
posted @ 2017-09-07 09:48 Jimmy_Cheng 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the  阅读全文
posted @ 2017-09-07 06:16 Jimmy_Cheng 阅读(282) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 27 下一页