Skip to content · ⁨דלג לתוכן⁩

Running sum · ⁨סכום רץ⁩

English

Running sum

Return a new array where position i holds the sum of all elements up to and including i: [1, 2, 3, 4] → [1, 3, 6, 10]. Keep a running total and fill a fresh int[] of the same length.

עברית

סכום רץ

החזר מערך חדש בו המיקום i מכיל את סכום כל האלמנטים עד ולכלול i: [1, 2, 3, 4] → [1, 3, 6, 10]. שמור על סכום רץ ומלא int[] חדש באותו אורך.

Log in or create account · ⁨היכנס או צור חשבון⁩

IGCSE, A-Level & AP