
算法
文章平均质量分 72
丫丫狸笫
A Girl
展开
-
最大连续矩形面积
POJ 2082转载 2016-08-28 14:42:23 · 924 阅读 · 0 评论 -
堆棋子与曼哈顿距离
堆棋子牛客网通道: https://www.nowcoder.com/questionTerminal/27f3672f17f94a289f3de86b69f8a25b小易将n个棋子摆放在一张无限大的棋盘上。第i个棋子放在第x[i]行y[i]列。同一个格子允许放置多个棋子。每一次操作小易可以把一个棋子拿起并将其移动到原格子的上、下、左、右的任意一个格子中。小易想知道要让棋盘上出现有一个格子中至少有原创 2017-08-15 13:34:02 · 824 阅读 · 0 评论 -
Leetcode 312: Burst Balloons
Leetcode 312: Burst Balloons Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst原创 2017-08-20 10:01:26 · 601 阅读 · 0 评论 -
Leetcode 300 :Longest Increasing Sequence
Leetcode 300Given an unsorted array of integers, find the length of longest increasing subsequence.For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The longest increasing subsequence is [2, 3, 7转载 2017-08-16 22:31:09 · 452 阅读 · 0 评论 -
Leetcode 560: Subarray Sum Equal k
Leetcode 560 Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k.Example 1: Input:nums = [1,1,1], k = 2 Output: 2Note:转载 2017-08-16 21:59:26 · 326 阅读 · 0 评论 -
Leetcode 44:Wildcard Matching
Leetcode 44:Wildcard MatchingImplement wildcard pattern matching with support for ‘?’ and ‘*’. ‘?’ Matches any single character. ‘*’ Matches any sequence of characters (including the empty sequenc转载 2017-08-17 21:22:04 · 337 阅读 · 0 评论 -
Leetcode 10: Regular Expression Matching
Leetcode 10: Regular Expression MatchingImplement regular expression matching with support for ‘.’ and ‘*’. ‘.’ Matches any single character. ‘*’ Matches zero or more of the preceding element.转载 2017-08-16 23:25:34 · 348 阅读 · 0 评论 -
Leetcode 307: Range Sum Query - Mutable 之BIT
题目传送门: Leetcode 307.Range Sum Query - Mutable题目 Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. The update(i, val) function modifies nums b原创 2017-05-03 15:55:46 · 432 阅读 · 0 评论 -
Leetcode 561: Array Partition I
题目传送门: Leetcode 561. Array Partition I题目: 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 min(ai,原创 2017-05-03 17:36:38 · 550 阅读 · 0 评论 -
小易喜欢的数列
小易喜欢的数列小易非常喜欢拥有以下性质的数列: 1、数列的长度为n 2、数列中的每个数都在1到k之间(包括1和k) 3、对于位置相邻的两个数A和B(A在B前),都满足(A <= B)或(A mod B != 0)(满足其一即可) 例如,当n = 4, k = 7 那么{1,7,7,2},它的长度是4,所有数字也在1到7范围内,并且满足第三条性质,所以小易是喜欢这个数列的 但是小易不喜欢{原创 2017-08-15 13:54:29 · 1637 阅读 · 0 评论