![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
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 = 2 Output: 2 ...原创 2019-09-08 02:01:26 · 152 阅读 · 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 · 709 阅读 · 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 · 2579 阅读 · 0 评论