Skip to content

Conversation

@Ja-hard
Copy link

@Ja-hard Ja-hard commented Oct 28, 2024

Simplified the logic while calculate the SmallSum.

Simplified the logic while calculate the SmallSum.
@Ja-hard
Copy link
Author

Ja-hard commented Oct 28, 2024

左侧窗口可以只右滑一次不后退。

已知 arr[a] < arr[b];
因为 arr[b] < arr[b+1];
所以 arr[a] < arr[b+1];

同时可以合并至 merge 过程,减少二次遍历。

@Ja-hard
Copy link
Author

Ja-hard commented Oct 28, 2024

抱歉,刚刚又看了眼,左神的代码里:

i = l, sum = 0

是包在 for 初始化语句而非更新语句里,那确实只右滑了一次。

@Ja-hard Ja-hard closed this Oct 29, 2024
@Ja-hard Ja-hard deleted the patch-1 branch November 2, 2024 15:21
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.

1 participant