随笔分类 -  Leetcode

上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页
leetcode 664. Strange Printer
摘要:There is a strange printer with the following two special requirements: Given a string consists of lower English letters only, your job is to count th 阅读全文
posted @ 2017-09-02 13:44 Beserious 阅读(1197) 评论(0) 推荐(0) 编辑
leetcode 447. Number of Boomerangs
摘要:Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between i and j equals 阅读全文
posted @ 2017-08-31 09:18 Beserious 阅读(174) 评论(0) 推荐(0) 编辑
leetcode 523. Continuous Subarray Sum
摘要:Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that 阅读全文
posted @ 2017-08-30 17:48 Beserious 阅读(328) 评论(0) 推荐(1) 编辑
leetcode 30. Substring with Concatenation of All Words
摘要:You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a conca 阅读全文
posted @ 2017-08-30 13:20 Beserious 阅读(249) 评论(0) 推荐(0) 编辑
leetcode 667. Beautiful Arrangement II
摘要:Given two integers n and k, you need to construct a list which contains n different positive integers ranging from 1 to n and obeys the following requ 阅读全文
posted @ 2017-08-29 16:12 Beserious 阅读(224) 评论(0) 推荐(0) 编辑
leetcode 666. Path Sum IV
摘要:If the depth of a tree is smaller than 5, then this tree can be represented by a list of three-digits integers. For each integer in this list: Given a 阅读全文
posted @ 2017-08-28 21:32 Beserious 阅读(364) 评论(0) 推荐(0) 编辑
leetcode 665. Non-decreasing Array
摘要: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-08-28 18:23 Beserious 阅读(220) 评论(0) 推荐(0) 编辑
leetcode 85. Maximal Rectangle
摘要:Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. For example, given the following 阅读全文
posted @ 2017-08-25 22:10 Beserious 阅读(173) 评论(0) 推荐(0) 编辑
leetcode 215. Kth Largest Element in an Array
摘要:Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For exam 阅读全文
posted @ 2017-08-24 18:20 Beserious 阅读(169) 评论(0) 推荐(0) 编辑
2018今日头条笔试(第二题)
摘要:题目描述 给定一个数组序列,需要选出一个区间,使得该区间是所有区间中经过如下计算的值最大的一个。 区间中的最小数 * 区间所有数的和 最后程序输出经过计算后的最大值即可,不需要输出具体的区间。如给定序列[6,2,1]可得到左右可以选定各个区间的计算值: [6]=6*6=36 [2]=2*2=4; [ 阅读全文
posted @ 2017-08-23 12:04 Beserious 阅读(937) 评论(0) 推荐(0) 编辑
leetcode 567. Permutation in String
摘要:Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string's permutati 阅读全文
posted @ 2017-08-23 08:02 Beserious 阅读(222) 评论(0) 推荐(0) 编辑
leetcode 417. Pacific Atlantic Water Flow
摘要:Given an m x n matrix of non-negative integers representing the height of each unit cell in a continent, the "Pacific ocean" touches the left and top 阅读全文
posted @ 2017-08-22 20:55 Beserious 阅读(300) 评论(0) 推荐(0) 编辑
leetcode 661. Image Smoother
摘要: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-08-20 12:26 Beserious 阅读(235) 评论(0) 推荐(0) 编辑
leetcode 663. Equal Tree Partition
摘要:Given a binary tree with n nodes, your task is to check if it's possible to partition the tree to two trees which have the equal sum of values after r 阅读全文
posted @ 2017-08-20 12:22 Beserious 阅读(301) 评论(0) 推荐(0) 编辑
leetcode 211. Add and Search Word - Data structure design
摘要:Design a data structure that supports the following two operations: search(word) can search a literal word or a regular expression string containing o 阅读全文
posted @ 2017-08-18 15:41 Beserious 阅读(315) 评论(0) 推荐(0) 编辑
leetcode 349. Intersection of Two Arrays
摘要:Given two arrays, write a function to compute their intersection. Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. Note: Each element i 阅读全文
posted @ 2017-08-18 08:57 Beserious 阅读(152) 评论(0) 推荐(0) 编辑
leetcode 659. Split Array into Consecutive Subsequences
摘要:You are given an integer array sorted in ascending order (may contain duplicates), you need to split them into several subsequences, where each subseq 阅读全文
posted @ 2017-08-17 21:56 Beserious 阅读(1348) 评论(0) 推荐(0) 编辑
leetcode 658. Find K Closest Elements
摘要:Given a sorted array, two integers k and x, find the k closest elements to x in the array. The result should also be sorted in ascending order. If the 阅读全文
posted @ 2017-08-16 18:24 Beserious 阅读(200) 评论(0) 推荐(0) 编辑
leetcode 657. Judge Route Circle
摘要:Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the or 阅读全文
posted @ 2017-08-16 18:11 Beserious 阅读(142) 评论(0) 推荐(0) 编辑
leetcode 179. Largest Number
摘要:Given a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest formed n 阅读全文
posted @ 2017-08-15 17:35 Beserious 阅读(150) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页