10 2017 档案

摘要:Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space fo 阅读全文
posted @ 2017-10-27 21:13 bernieloveslife 阅读(149) 评论(0) 推荐(0)
摘要: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 ex 阅读全文
posted @ 2017-10-27 14:50 bernieloveslife 阅读(116) 评论(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-10-27 14:46 bernieloveslife 阅读(127) 评论(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-10-27 14:26 bernieloveslife 阅读(111) 评论(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-10-27 14:18 bernieloveslife 阅读(114) 评论(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-10-27 14:03 bernieloveslife 阅读(144) 评论(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-10-27 13:35 bernieloveslife 阅读(123) 评论(0) 推荐(0)
摘要:Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an inte 阅读全文
posted @ 2017-10-26 19:51 bernieloveslife 阅读(149) 评论(0) 推荐(0)
摘要:Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of 阅读全文
posted @ 2017-10-26 18:36 bernieloveslife 阅读(106) 评论(0) 推荐(0)
摘要:Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be 阅读全文
posted @ 2017-10-26 18:31 bernieloveslife 阅读(110) 评论(0) 推荐(0)
摘要:Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, flowers cannot be planted in adjacent plots - they 阅读全文
posted @ 2017-10-26 15:32 bernieloveslife 阅读(137) 评论(0) 推荐(0)
摘要:Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Example 2: Note: 阅读全文
posted @ 2017-10-26 15:13 bernieloveslife 阅读(123) 评论(0) 推荐(0)
摘要:Given an array consisting of n integers, find the contiguous subarray of given length k that has the maximum average value. And you need to output the 阅读全文
posted @ 2017-10-23 13:43 bernieloveslife 阅读(150) 评论(0) 推荐(0)
摘要:In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new one with different size but keep its original data. 阅读全文
posted @ 2017-10-23 13:36 bernieloveslife 阅读(137) 评论(0) 推荐(0)
摘要:Given a 2D integer matrix M representing the gray scale of an image, you need to design a smoother to make the gray scale of each cell becomes the ave 阅读全文
posted @ 2017-10-19 20:29 bernieloveslife 阅读(113) 评论(0) 推荐(0)
摘要:Given an array with n integers, your task is to check if it could become non-decreasing by modifying at most 1 element. We define an array is non-decr 阅读全文
posted @ 2017-10-19 15:32 bernieloveslife 阅读(163) 评论(0) 推荐(0)
摘要:Given an unsorted array of integers, find the length of longest continuous increasing subsequence. Example 1: Example 2: Note: Length of the array wil 阅读全文
posted @ 2017-10-19 15:17 bernieloveslife 阅读(191) 评论(0) 推荐(0)
摘要:Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. Your t 阅读全文
posted @ 2017-10-19 14:12 bernieloveslife 阅读(209) 评论(0) 推荐(0)
摘要:Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementing n 阅读全文
posted @ 2017-10-19 12:24 bernieloveslife 阅读(132) 评论(0) 推荐(0)
摘要:Given an m * n matrix M initialized with all 0's and several update operations. Operations are represented by a 2D array, and each operation is repres 阅读全文
posted @ 2017-10-19 11:14 bernieloveslife 阅读(150) 评论(0) 推荐(0)
摘要:For a web developer, it is very important to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now i 阅读全文
posted @ 2017-10-19 10:55 bernieloveslife 阅读(178) 评论(0) 推荐(0)