随笔分类 -  leetcode

上一页 1 ··· 13 14 15 16 17
https://leetcode.com/problemset/all/
摘要: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 阅读(111) 评论(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 阅读(151) 评论(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 阅读(114) 评论(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 阅读(164) 评论(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 阅读(179) 评论(0) 推荐(0)
摘要:Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, return its corresponding column number. For example: Cr 阅读全文
posted @ 2017-09-30 19:06 bernieloveslife 阅读(148) 评论(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 @ 2017-09-29 12:40 bernieloveslife 阅读(128) 评论(0) 推荐(0)
摘要:Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the rans 阅读全文
posted @ 2017-09-29 10:58 bernieloveslife 阅读(126) 评论(0) 推荐(0)
摘要:Invert a binary tree. to Trivia: This problem was inspired by this original tweet by Max Howell: Python Solution: 阅读全文
posted @ 2017-09-29 10:44 bernieloveslife 阅读(119) 评论(0) 推荐(0)
摘要:Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l 阅读全文
posted @ 2017-09-29 10:23 bernieloveslife 阅读(130) 评论(0) 推荐(0)
摘要: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-29 10:09 bernieloveslife 阅读(166) 评论(0) 推荐(0)

上一页 1 ··· 13 14 15 16 17