From 038d50957cff8e3e370a1812ff36afa5feb72945 Mon Sep 17 00:00:00 2001 From: jinbudaily <18336218010@163.com> Date: Wed, 26 Jul 2023 15:58:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=200674.=E6=9C=80=E9=95=BF?= =?UTF-8?q?=E8=BF=9E=E7=BB=AD=E9=80=92=E5=A2=9E=E5=BA=8F=E5=88=97=20?= =?UTF-8?q?=E6=8E=92=E7=89=88=E6=A0=BC=E5=BC=8F=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0300.最长上升子序列.md | 24 +++++++++++------------ problems/0674.最长连续递增序列.md | 18 +++++++++-------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/problems/0300.最长上升子序列.md b/problems/0300.最长上升子序列.md index c58c3bf6..11cf13d9 100644 --- a/problems/0300.最长上升子序列.md +++ b/problems/0300.最长上升子序列.md @@ -33,7 +33,7 @@ ## 算法公开课 -**《代码随想录》算法视频公开课:[动态规划之子序列问题,元素不连续!| LeetCode:300.最长递增子序列](https://www.bilibili.com/video/BV1ng411J7xP),相信结合视频再看本篇题解,更有助于大家对本题的理解**。 +**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html)::[动态规划之子序列问题,元素不连续!| LeetCode:300.最长递增子序列](https://www.bilibili.com/video/BV1ng411J7xP),相信结合视频再看本篇题解,更有助于大家对本题的理解**。 ## 思路 @@ -124,8 +124,8 @@ public: ## 其他语言版本 +### Java: -Java: ```Java class Solution { public int lengthOfLIS(int[] nums) { @@ -147,7 +147,7 @@ class Solution { } ``` -Python: +### Python: DP ```python @@ -189,7 +189,8 @@ class Solution: return len(tails) # 返回递增子序列的长度 ``` -Go: +### Go: + ```go // 动态规划求解 func lengthOfLIS(nums []int) int { @@ -248,7 +249,8 @@ func lengthOfLIS(nums []int ) int { } ``` -Javascript +### Javascript: + ```javascript const lengthOfLIS = (nums) => { let dp = Array(nums.length).fill(1); @@ -267,7 +269,7 @@ const lengthOfLIS = (nums) => { }; ``` -TypeScript +### TypeScript: ```typescript function lengthOfLIS(nums: number[]): number { @@ -288,7 +290,8 @@ function lengthOfLIS(nums: number[]): number { }; ``` -Rust: +### Rust: + ```rust pub fn length_of_lis(nums: Vec) -> i32 { let mut dp = vec![1; nums.len() + 1]; @@ -307,13 +310,8 @@ pub fn length_of_lis(nums: Vec) -> i32 { - - - - - -

+ diff --git a/problems/0674.最长连续递增序列.md b/problems/0674.最长连续递增序列.md index 8cc270ec..0c5e64b3 100644 --- a/problems/0674.最长连续递增序列.md +++ b/problems/0674.最长连续递增序列.md @@ -29,7 +29,7 @@ ## 算法公开课 -**《代码随想录》算法视频公开课:[动态规划之子序列问题,重点在于连续!| LeetCode:674.最长连续递增序列](https://www.bilibili.com/video/BV1bD4y1778v),相信结合视频再看本篇题解,更有助于大家对本题的理解**。 +**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[动态规划之子序列问题,重点在于连续!| LeetCode:674.最长连续递增序列](https://www.bilibili.com/video/BV1bD4y1778v),相信结合视频再看本篇题解,更有助于大家对本题的理解**。 ## 思路 @@ -157,8 +157,7 @@ public: ## 其他语言版本 - -Java: +### Java: > 动态规划: ```java @@ -207,7 +206,7 @@ public static int findLengthOfLCIS(int[] nums) { } ``` -Python: +### Python: DP ```python @@ -261,7 +260,8 @@ class Solution: return result ``` -Go: +### Go: + > 动态规划: ```go func findLengthOfLCIS(nums []int) int { @@ -302,7 +302,8 @@ func findLengthOfLCIS(nums []int) int { } ``` -Rust: +### Rust: + ```rust pub fn find_length_of_lcis(nums: Vec) -> i32 { if nums.is_empty() { @@ -320,7 +321,7 @@ pub fn find_length_of_lcis(nums: Vec) -> i32 { } ``` -Javascript: +### Javascript: > 动态规划: ```javascript @@ -363,7 +364,7 @@ const findLengthOfLCIS = (nums) => { }; ``` -TypeScript: +### TypeScript: > 动态规划: @@ -409,3 +410,4 @@ function findLengthOfLCIS(nums: number[]): number { +