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.

ไทย

Running sum

คืนอาเรย์ใหม่โดยที่ตำแหน่ง i เก็บผลรวมของทุกองค์ประกอบจนถึงและรวมถึง i: [1, 2, 3, 4] → [1, 3, 6, 10]. Keep running total และเติม fresh int[] ที่มีความยาวเท่ากัน

Log in or create account · ⁨เข้าสู่ระบบหรือสร้างบัญชี⁩

IGCSE, A-Level & AP