摘要: Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. For ex 阅读全文
posted @ 2018-04-15 14:48 一日一更 阅读(73) 评论(0) 推荐(0) 编辑
摘要: Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1 Example 2 Note:Your al 阅读全文
posted @ 2018-04-15 14:27 一日一更 阅读(96) 评论(0) 推荐(0) 编辑
摘要: Your are given an array of integers prices, for which the i-th element is the price of a given stock on day i; and a non-negative integer fee represen 阅读全文
posted @ 2018-04-14 15:06 一日一更 阅读(91) 评论(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 @ 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) 编辑