Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[pull] master from youngyangyang04:master #317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
pull merged 16 commits into AlgorithmAndLeetCode:master from youngyangyang04:master
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
6ed304e
更新 动态规划理论基础 排版格式修复
jinbudaily Jul 26, 2023
b295b12
更新 0509.斐波那契数 排版格式修复
jinbudaily Jul 26, 2023
9b24f3c
更新 0070.爬楼梯 排版格式修复
jinbudaily Jul 26, 2023
86f794b
更新 0746.使用最小花费爬楼梯 排版格式修复
jinbudaily Jul 26, 2023
0e3500e
更新 动态规划 周末总结 排版格式修复
jinbudaily Jul 26, 2023
126aaac
更新 背包理论基础 排版格式修复
jinbudaily Jul 26, 2023
fc19feb
更新 0416.分割等和自己 0474.一和零 0494.目标和 1049.最后一块石头的重量II 排版格式修复
jinbudaily Jul 26, 2023
7ac2179
更新 完全背包理论基础 0139.单词拆分 0279.完全平方数 0322.零钱兑换 0377.组合总和IV 0518.零钱兑换II 多重...
jinbudaily Jul 26, 2023
89571ea
更新 0198.打家劫舍 0213.打家劫舍II 0337.打家劫舍III 排版格式修复
jinbudaily Jul 26, 2023
6b32268
更新 买卖股票的最佳时机系列 排版格式修复
jinbudaily Jul 26, 2023
038d509
更新 0674.最长连续递增序列 排版格式修复
jinbudaily Jul 26, 2023
9b0c0f2
更新 0392.判断子序列 0718.最长重复子数组 1035.不相交的线 1143.最长公共子序列 排版格式修复
jinbudaily Jul 26, 2023
a0edc60
更新 编辑距离系列 排版格式修复
jinbudaily Jul 26, 2023
4760924
更新 0516.最长回文子序列 0647.回文子串 动态规划总结 排版格式修复
jinbudaily Jul 26, 2023
04dd0ec
Merge branch 'master' of github.com:jinbudaily/leetcode-master
jinbudaily Jul 26, 2023
2691e27
Merge pull request #2208 from jinbudaily/master
youngyangyang04 Jul 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
更新 0416.分割等和自己 0474.一和零 0494.目标和 1049.最后一块石头的重量II 排版格式修复
  • Loading branch information
jinbudaily committed Jul 26, 2023
commit fc19feb04939aee16372c6a6880a4a0ee3373110
13 changes: 7 additions & 6 deletions problems/0416.分割等和子集.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
* 1 <= nums.length <= 200
* 1 <= nums[i] <= 100

# 算法公开课
## 算法公开课

**《代码随想录》算法视频公开课:[动态规划之背包问题,这个包能装满吗?| LeetCode:416.分割等和子集](https://www.bilibili.com/video/BV1rt4y1N7jE/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[动态规划之背包问题,这个包能装满吗?| LeetCode:416.分割等和子集](https://www.bilibili.com/video/BV1rt4y1N7jE/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。


## 思路
Expand All @@ -53,7 +53,7 @@
* [动态规划:关于01背包问题,你该了解这些!](https://programmercarl.com/背包理论基础01背包-1.html)
* [动态规划:关于01背包问题,你该了解这些!(滚动数组)](https://programmercarl.com/背包理论基础01背包-2.html)

## 01背包问题
### 01背包问题

背包问题,大家都知道,有N件物品和一个最多能背重量为W 的背包。第i件物品的重量是weight[i],得到的价值是value[i] 。每件物品只能用一次,求解将哪些物品装入背包里物品价值总和最大。

Expand Down Expand Up @@ -479,7 +479,7 @@ func canPartition(nums []int) bool {
}
```

### javaScript:
### JavaScript:

```js
var canPartition = function(nums) {
Expand All @@ -499,7 +499,7 @@ var canPartition = function(nums) {
```


### Rust
### Rust:

```Rust
impl Solution {
Expand Down Expand Up @@ -681,7 +681,7 @@ function canPartition(nums: number[]): boolean {
};
```

### Scala
### Scala:

滚动数组:
```scala
Expand Down Expand Up @@ -730,3 +730,4 @@ object Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

5 changes: 3 additions & 2 deletions problems/0474.一和零.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
* strs[i] 仅由 '0' 和 '1' 组成
* 1 <= m, n <= 100

# 算法公开课
## 算法公开课

**《代码随想录》算法视频公开课:[装满这个背包最多用多少个物品?| LeetCode:474.一和零](https://www.bilibili.com/video/BV1rW4y1x7ZQ/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[装满这个背包最多用多少个物品?| LeetCode:474.一和零](https://www.bilibili.com/video/BV1rW4y1x7ZQ/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。


## 思路
Expand Down Expand Up @@ -538,3 +538,4 @@ impl Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

11 changes: 5 additions & 6 deletions problems/0494.目标和.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
* 初始的数组的和不会超过 1000 。
* 保证返回的最终结果能被 32 位整数存下。

# 算法公开课
## 算法公开课

**《代码随想录》算法视频公开课:[装满背包有多少种方法?| LeetCode:494.目标和](https://www.bilibili.com/video/BV1o8411j73x/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[装满背包有多少种方法?| LeetCode:494.目标和](https://www.bilibili.com/video/BV1o8411j73x/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。


## 思路
Expand Down Expand Up @@ -67,7 +67,7 @@ target是固定的,sum是固定的,left就可以求出来。

此时问题就是在集合nums中找出和为left的组合。

## 回溯算法
### 回溯算法

在回溯算法系列中,一起学过这道题目[回溯算法:39. 组合总和](https://programmercarl.com/0039.组合总和.html)的录友应该感觉很熟悉,这不就是组合总和问题么?

Expand Down Expand Up @@ -118,7 +118,7 @@ public:

也可以使用记忆化回溯,但这里我就不在回溯上下功夫了,直接看动规吧

## 动态规划
### 动态规划

如何转化为01背包问题呢。

Expand Down Expand Up @@ -519,8 +519,6 @@ const findTargetSumWays = (nums, target) => {

### TypeScript

TypeScript:

```ts
function findTargetSumWays(nums: number[], target: number): number {
// 把数组分成两个组合left, right.left + right = sum, left - right = target.
Expand Down Expand Up @@ -590,3 +588,4 @@ impl Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

13 changes: 7 additions & 6 deletions problems/1049.最后一块石头的重量II.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
* 1 <= stones.length <= 30
* 1 <= stones[i] <= 1000

# 算法公开课
## 算法公开课

**《代码随想录》算法视频公开课:[这个背包最多能装多少?LeetCode:1049.最后一块石头的重量II](https://www.bilibili.com/video/BV14M411C7oV/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[这个背包最多能装多少?LeetCode:1049.最后一块石头的重量II](https://www.bilibili.com/video/BV14M411C7oV/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。


## 思路
Expand Down Expand Up @@ -341,7 +341,7 @@ func max(a, b int) int {
}
```

### JavaScript
### JavaScript:

```javascript
/**
Expand All @@ -364,7 +364,7 @@ var lastStoneWeightII = function (stones) {
};
```

### C
### C:
```c
#define MAX(a, b) (((a) > (b)) ? (a) : (b))

Expand Down Expand Up @@ -413,7 +413,7 @@ function lastStoneWeightII(stones: number[]): number {
};
```

### Scala
### Scala:

滚动数组:
```scala
Expand Down Expand Up @@ -455,7 +455,7 @@ object Solution {
}
```

### Rust
### Rust:

```rust
impl Solution {
Expand All @@ -477,3 +477,4 @@ impl Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

AltStyle によって変換されたページ (->オリジナル) /