更新 0198.打家劫舍 0213.打家劫舍II 0337.打家劫舍III 排版格式修复

This commit is contained in:
jinbudaily
2023-07-26 15:33:10 +08:00
parent 7ac217942f
commit 89571ea8f8
3 changed files with 22 additions and 19 deletions

View File

@ -31,9 +31,9 @@
* 0 <= nums.length <= 100
* 0 <= nums[i] <= 400
# 算法公开课
## 算法公开课
**《代码随想录》算法视频公开课:[动态规划,偷不偷这个房间呢?| LeetCode198.打家劫舍](https://www.bilibili.com/video/BV1Te411N7SX),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html)[动态规划,偷不偷这个房间呢?| LeetCode198.打家劫舍](https://www.bilibili.com/video/BV1Te411N7SX),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
## 思路
@ -121,8 +121,8 @@ public:
## 其他语言版本
### Java
Java
```Java
// 动态规划
class Solution {
@ -194,7 +194,7 @@ class Solution {
}
```
Python
### Python
1维DP
```python
@ -255,7 +255,8 @@ class Solution:
```
Go
### Go
```Go
func rob(nums []int) int {
n := len(nums)
@ -275,7 +276,7 @@ func max(a, b int) int {
}
```
JavaScript
### JavaScript
```javascript
const rob = nums => {
@ -291,7 +292,7 @@ const rob = nums => {
};
```
TypeScript
### TypeScript
```typescript
function rob(nums: number[]): number {
@ -314,7 +315,7 @@ function rob(nums: number[]): number {
};
```
Rust:
### Rust:
```rust
impl Solution {
@ -338,4 +339,3 @@ impl Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

View File

@ -31,9 +31,9 @@
* 1 <= nums.length <= 100
* 0 <= nums[i] <= 1000
# 算法公开课
## 算法公开课
**《代码随想录》算法视频公开课:[动态规划,房间连成环了那还偷不偷呢?| LeetCode213.打家劫舍II](https://www.bilibili.com/video/BV1oM411B7xq),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html)[动态规划,房间连成环了那还偷不偷呢?| LeetCode213.打家劫舍II](https://www.bilibili.com/video/BV1oM411B7xq),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
## 思路
@ -104,8 +104,8 @@ public:
## 其他语言版本
### Java
Java
```Java
class Solution {
public int rob(int[] nums) {
@ -129,7 +129,7 @@ class Solution {
}
```
Python
### Python
```Python
class Solution:
@ -219,7 +219,7 @@ class Solution:
```
Go
### Go
```go
// 打家劫舍Ⅱ 动态规划
@ -257,7 +257,8 @@ func max(a, b int) int {
}
```
javascipt:
### JavaScript:
```javascript
var rob = function(nums) {
const n = nums.length
@ -279,7 +280,7 @@ const robRange = (nums, start, end) => {
return dp[end]
}
```
TypeScript
### TypeScript
```typescript
function rob(nums: number[]): number {
@ -301,7 +302,7 @@ function robRange(nums: number[], start: number, end: number): number {
}
```
Rust:
### Rust:
```rust
impl Solution {
@ -336,3 +337,4 @@ impl Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

View File

@ -16,9 +16,9 @@
![337.打家劫舍III](https://code-thinking-1253855093.file.myqcloud.com/pics/20210223173849619.png)
# 算法公开课
## 算法公开课
**《代码随想录》算法视频公开课:[动态规划,房间连成树了,偷不偷呢?| LeetCode337.打家劫舍3](https://www.bilibili.com/video/BV1H24y1Q7sY),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html)[动态规划,房间连成树了,偷不偷呢?| LeetCode337.打家劫舍3](https://www.bilibili.com/video/BV1H24y1Q7sY),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
## 思路
@ -523,3 +523,4 @@ impl Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>