更新 0674.最长连续递增序列 排版格式修复

This commit is contained in:
jinbudaily
2023-07-26 15:58:53 +08:00
parent 6b322684a4
commit 038d50957c
2 changed files with 21 additions and 21 deletions

View File

@ -33,7 +33,7 @@
## 算法公开课
**《代码随想录》算法视频公开课:[动态规划之子序列问题,元素不连续!| LeetCode300.最长递增子序列](https://www.bilibili.com/video/BV1ng411J7xP),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html)[动态规划之子序列问题,元素不连续!| LeetCode300.最长递增子序列](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>) -> i32 {
let mut dp = vec![1; nums.len() + 1];
@ -307,13 +310,8 @@ pub fn length_of_lis(nums: Vec<i32>) -> i32 {
<p align="center">
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

View File

@ -29,7 +29,7 @@
## 算法公开课
**代码随想录算法视频公开课[动态规划之子序列问题,重点在于连续!| LeetCode674.最长连续递增序列](https://www.bilibili.com/video/BV1bD4y1778v)相信结合视频再看本篇题解更有助于大家对本题的理解**。
**[代码随想录算法视频公开课](https://programmercarl.com/other/gongkaike.html)[动态规划之子序列问题,重点在于连续!| LeetCode674.最长连续递增序列](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>) -> i32 {
if nums.is_empty() {
@ -320,7 +321,7 @@ pub fn find_length_of_lcis(nums: Vec<i32>) -> i32 {
}
```
Javascript
### Javascript
> 动态规划:
```javascript
@ -363,7 +364,7 @@ const findLengthOfLCIS = (nums) => {
};
```
TypeScript
### TypeScript
> 动态规划:
@ -409,3 +410,4 @@ function findLengthOfLCIS(nums: number[]): number {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>