File tree Expand file tree Collapse file tree 2 files changed +24
-6
lines changed
Expand file tree Collapse file tree 2 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 11---
22title : 2270. Number of Ways to Split Array.md
3- date : ' 2025/1/14-9:31'
3+ date : " 2025/1/14-9:31"
44tags :
55 - - Python
66 - - Answer
77abbrlink : c25bb550
8+ docId : a6inw303oslb7i5tcqj5xxx4
89---
910
1011# QUESTION:
1112
1213[ 2270. Number of Ways to Split Array.md] ( https://leetcode.cn/problems/number-of-ways-to-split-array/description/ )
1314
1415# My Think:
16+
1517` 2 <= nums.length <= 105 ` , 因此我们可以直接获取到第一个数字, 初始状态就在指针于index0, 正要往index1走的时候.
1618然后只需要一次For循环就可以搞定
1719
18-
1920重点是第二个方法, 来自题解.
2021
2122# Code:
@@ -37,4 +38,4 @@ class Solution:
3738``` python
3839t = (sum (nums) + 1 ) // 2
3940return sum (s >= t for s in accumulate(nums[:- 1 ]))
40- ```
41+ ```
Original file line number Diff line number Diff line change 11{
22 "repo" : " InvolutionHell/involutionhell" ,
3- "generatedAt" : " 2025-11-12T03:05:31.078Z " ,
3+ "generatedAt" : " 2025-11-13T03:06:20.335Z " ,
44 "docsDir" : " app/docs" ,
5- "totalDocs" : 110 ,
5+ "totalDocs" : 111 ,
66 "results" : [
77 {
88 "docId" : " ue27z7z95yzw3lhhfj7nit1c" ,
20372037 {
20382038 "docId" : " bsf0yz1zrmlz7masrdmq8fq6" ,
20392039 "path" : " app/docs/CommunityShare/Leetcode/1653. 使字符串平衡的最少删除次数_translated.md" ,
2040+ "contributorStats" : {
2041+ "114939201" : 2
2042+ },
2043+ "contributors" : [
2044+ {
2045+ "githubId" : " 114939201" ,
2046+ "contributions" : 2 ,
2047+ "lastContributedAt" : " 2025-11-12T03:05:32.000Z" ,
2048+ "login" : " longsizhuo" ,
2049+ "avatarUrl" : " https://avatars.githubusercontent.com/u/114939201?v=4" ,
2050+ "htmlUrl" : " https://github.com/longsizhuo"
2051+ }
2052+ ]
2053+ },
2054+ {
2055+ "docId" : " a6inw303oslb7i5tcqj5xxx4" ,
2056+ "path" : " app/docs/CommunityShare/Leetcode/2270. Number of Ways to Split Array.md" ,
20402057 "contributorStats" : {
20412058 "114939201" : 1
20422059 },
20432060 "contributors" : [
20442061 {
20452062 "githubId" : " 114939201" ,
20462063 "contributions" : 1 ,
2047- "lastContributedAt" : " 2025-11-12T03 :00:17 .000Z" ,
2064+ "lastContributedAt" : " 2025-11-13T03 :00:08 .000Z" ,
20482065 "login" : " longsizhuo" ,
20492066 "avatarUrl" : " https://avatars.githubusercontent.com/u/114939201?v=4" ,
20502067 "htmlUrl" : " https://github.com/longsizhuo"
You can’t perform that action at this time.
0 commit comments