You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: content/3_Silver/Prefix_Sums.mdx
+28-10
Original file line number
Diff line number
Diff line change
@@ -185,7 +185,6 @@ These are also known as
185
185
##Solution-StaticRangeSum
186
186
187
187
<LanguageSection>
188
-
189
188
<CPPSection>
190
189
191
190
InC++wecanuse
@@ -223,7 +222,6 @@ int main() {
223
222
```
224
223
225
224
</CPPSection>
226
-
227
225
<JavaSection>
228
226
229
227
```java
@@ -269,20 +267,17 @@ public class Main {
269
267
```
270
268
271
269
</JavaSection>
272
-
273
270
<PySection>
274
271
275
-
In Python you can use [itertools.accumulate](https://docs.python.org/3.6/library/itertools.html#itertools.accumulate). Note that you have to call list() since accumulate returns a [generator](https://wiki.python.org/moin/Generators). The first value returned is that of the iterable passed, so we add a zero in the front (in newer versions you can give the optional parameter of initial=0).
0 commit comments