Running sum · 누적 합계
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · 이 페이지는 최신 브라우저(SharedArrayBuffer 지원)가 필요합니다. Chrome, Edge, Firefox 또는 Safari를 최신 버전으로 업데이트해 주세요.
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[]을 채웁니다.
Complete runningSum(int[] nums) so result position i is the sum nums[0] + ... + nums[i]. Example: [1,2,3,4] becomes [1,3,6,10]. · runningSum(int[] nums)를 완성하여 결과의 위치 i이 nums[0] + ... + nums[i]의 합이 되도록 하십시오. 예시: [1,2,3,4]이 [1,3,6,10]로 바뀝니다.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.