From a14c0f2472a2017b23eed83e96410b29ec1bd7d6 Mon Sep 17 00:00:00 2001 From: yanglbme Date: Mon, 25 Nov 2024 12:50:39 +0800 Subject: [PATCH 1/2] feat: add solutions to lc problem: No.3368 No.3368.First Letter Capitalization --- .../README.md | 4 +- .../README.md | 42 +++---- .../README.md | 103 +++++++++++++----- .../README_EN.md | 52 +++++++++ .../Solution.py | 10 ++ .../Solution.sql | 38 +++++++ solution/DATABASE_README.md | 2 +- solution/README.md | 4 +- solution/main.py | 2 +- 9 files changed, 205 insertions(+), 52 deletions(-) create mode 100644 solution/3300-3399/3368.First Letter Capitalization/Solution.py create mode 100644 solution/3300-3399/3368.First Letter Capitalization/Solution.sql diff --git a/solution/3300-3399/3355.Zero Array Transformation I/README.md b/solution/3300-3399/3355.Zero Array Transformation I/README.md index f480e91a5527e..77d4c74f29890 100644 --- a/solution/3300-3399/3355.Zero Array Transformation I/README.md +++ b/solution/3300-3399/3355.Zero Array Transformation I/README.md @@ -22,7 +22,7 @@ tags:

对于每个查询 queries[i]

@@ -30,8 +30,6 @@ tags:

如果在按顺序处理所有查询后,可以将 nums 转换为 零数组 ,则返回 true,否则返回 false

-

数组的 子集 是对数组元素的选择(可能为空)。

-

 

示例 1:

diff --git a/solution/3300-3399/3359.Find Sorted Submatrices With Maximum Element at Most K/README.md b/solution/3300-3399/3359.Find Sorted Submatrices With Maximum Element at Most K/README.md index bd3e5fd2aca1d..2c3f09746e977 100644 --- a/solution/3300-3399/3359.Find Sorted Submatrices With Maximum Element at Most K/README.md +++ b/solution/3300-3399/3359.Find Sorted Submatrices With Maximum Element at Most K/README.md @@ -6,7 +6,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3359.Fi -# [3359. Find Sorted Submatrices With Maximum Element at Most K 🔒](https://leetcode.cn/problems/find-sorted-submatrices-with-maximum-element-at-most-k) +# [3359. 查找最大元素不超过 K 的有序子矩阵 🔒](https://leetcode.cn/problems/find-sorted-submatrices-with-maximum-element-at-most-k) [English Version](/solution/3300-3399/3359.Find%20Sorted%20Submatrices%20With%20Maximum%20Element%20at%20Most%20K/README_EN.md) @@ -14,30 +14,31 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3359.Fi -

You are given a 2D matrix grid of size m x n. You are also given a non-negative integer k.

+

给定一个大小为 m x n 的二维矩阵 grid。同时给定一个 非负整数 k

-

Return the number of submatrices of grid that satisfy the following conditions:

+

返回满足下列条件的 grid 的子矩阵:

-

A submatrix (x1, y1, x2, y2) is a matrix that forms by choosing all cells grid[x][y] where x1 <= x <= x2 and y1 <= y <= y2.

+

矩阵的子矩阵 (x1, y1, x2, y2) 是通过选择所有满足 x1 <= x <= x2 且 y1 <= y <= y2 的 grid[x][y] 元素组成的矩阵。

 

-

Example 1:

+ +

示例 1:

-

Input: grid = [[4,3,2,1],[8,7,6,1]], k = 3

+

输入:grid = [[4,3,2,1],[8,7,6,1]], k = 3

-

Output: 8

+

输出:8

-

Explanation:

+

解释:

-

The 8 submatrices are:

+

8 个子矩阵分别是:

-

Example 2:

+

示例 2:

-

Input: grid = [[1,1,1],[1,1,1],[1,1,1]], k = 1

+

输入:grid = [[1,1,1],[1,1,1],[1,1,1]], k = 1

-

Output: 36

+

输出:36

-

Explanation:

+

解释:

-

There are 36 submatrices of grid. All submatrices have their maximum element equal to 1.

+

矩阵中有 36 个子矩阵。所有子矩阵的最大元素都等于 1。

-

Example 3:

+

示例 3:

-

Input: grid = [[1]], k = 1

+

输入:grid = [[1]], k = 1

-

Output: 1

+

输出:1

 

-

Constraints:

+ +

提示: