Skip to content
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

0209.长度最小的子数组.md #627

Closed
casnz1601 opened this issue Aug 19, 2021 · 0 comments
Closed

0209.长度最小的子数组.md #627

casnz1601 opened this issue Aug 19, 2021 · 0 comments

Comments

@casnz1601
Copy link
Contributor

究竟为什么会出现两次 sum = 0???

class Solution {
public:
int minSubArrayLen(int s, vector& nums) {
int result = INT32_MAX; // 最终的结果
int sum = 0; // 子序列的数值之和
int subLength = 0; // 子序列的长度
for (int i = 0; i < nums.size(); i++) { // 设置子序列起点为i
sum = 0;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant