摘要: 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 @ 2018-04-13 17:33 一日一更 阅读(92) 评论(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 @ 2018-04-13 15:09 一日一更 阅读(79) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr 阅读全文
posted @ 2018-04-13 14:38 一日一更 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-04-13 14:35 一日一更 阅读(88) 评论(0) 推荐(0) 编辑
摘要: Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be 阅读全文
posted @ 2018-04-13 14:16 一日一更 阅读(58) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2018-04-13 13:50 一日一更 阅读(92) 评论(0) 推荐(0) 编辑
摘要: Given an array arr that is a permutation of [0, 1, ..., arr.length - 1], we split the array into some number of "chunks" (partitions), and individuall 阅读全文
posted @ 2018-04-13 13:45 一日一更 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-04-13 00:30 一日一更 阅读(67) 评论(0) 推荐(0) 编辑
摘要: A zero-indexed array A of length N contains all integers from 0 to N-1. Find and return the longest length of set S, where S[i] = {A[i], A[A[i]], A[A[ 阅读全文
posted @ 2018-04-13 00:26 一日一更 阅读(84) 评论(0) 推荐(0) 编辑