
treeset/map
老晨磕技术
每天定时定量,持之以恒。一天一点数十年持续积累,坚持的人总不会混得太差。
展开
-
晨哥Leetcode 363. Max Sum of Rectangle No Larger Than K
Given a non-empty 2D matrix matrix and an integer k, find the max sum of a rectangle in the matrix such that its sum is no larger than k.Example:Input: matrix = [[1,0,1],[0,-2,3]], k = 2Output: 2...原创 2019-09-08 02:01:26 · 185 阅读 · 0 评论 -
老晨Leetcode 792. 满足要求的子串个数Number of Matching Subsequences(Java)
给定一个字符串S 和一个单词字典 words,问, words中一共有多少个单词words[i]是字符串S的子序列?注意, 子序列不同于子串, 子序列不要求连续.这题的一种容易懂的解法是这样的把字符串S里的所有字符统计一下,记录它们出现的位置然后判断一个个word是不是它的子序列的时候,一个个字符去扫描假设这个单词是abc, 原串是adsferertbca一开始找到了a的最左边的...原创 2019-09-16 10:54:51 · 756 阅读 · 0 评论 -
老晨Leetcode 1055. Shortest Way to Form String (Java)
From any string, we can form a subsequence of that string by deleting some number of characters (possibly no deletions).Given two strings source and target, return the minimum number of subsequences...原创 2019-09-16 11:24:33 · 2679 阅读 · 0 评论