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

#1031 动态规划: 求解数组中两个非重叠子数组的最大和, O(n)算法 #25

Merged
merged 1 commit into from
Jun 11, 2019

Conversation

winnochan
Copy link
Contributor

No description provided.

Copy link
Owner

@azl397985856 azl397985856 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

另外建议使用drawio画图,然后将drawio源文件一起提交上来


## 思路(动态规划)

题目中要求在前N(数组长度)个数中找出长度分别为L和M的非重叠子数组之和的最大值, 因此, 我们可以定义数组A中前i个数可构成的非重叠子数组L和M的最大值为SUMM[i], 并找到SUMM[i]和SUMM[i-1]的关系, 那么最终解就是SUMM[N]. 以下为图解:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里应该是SUM[i], 而不是SUMM[i]吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是SUMM, 只是一个数组名, 图中和描述对应就好了

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drawio已经提交了

@azl397985856 azl397985856 merged commit fc8c6f3 into azl397985856:master Jun 11, 2019
azl397985856 pushed a commit that referenced this pull request Apr 5, 2020
* feat(js-solution): add js-solution for problem 4

* feat(js-solution): add js solution for problem 25

* feat: #32 栈解法
baicaihenxiao pushed a commit to baicaihenxiao/leetcode-frontend that referenced this pull request Apr 14, 2020
…56#338)

* feat(js-solution): add js-solution for problem 4

* feat(js-solution): add js solution for problem 25

* feat: azl397985856#32 栈解法
azl397985856 pushed a commit that referenced this pull request Aug 19, 2023
* feat(js-solution): add js-solution for problem 4

* feat(js-solution): add js solution for problem 25

* feat: #32 栈解法
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

Successfully merging this pull request may close these issues.

2 participants