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