Given an array nums. We define a running sum of an array as runningSum [ i ] = sum ( nums[ 0 ] ... nums [ i ] ). Return the running sum of nums. nums์ ๋ฐฐ์ด์ด ์ฃผ์ด์ง๋ค. ๊ฐ ๋ฐฐ์ด์ ํฉ์ runningSum [ i ] = sum ( nums[ 0 ] ... nums [ i ] ) ์ผ๋ก ๋ง๋ค์ด๋ผ. ๊ทธ๋ฆฌ๊ณ ๋ฐฐ์ด์ ๋ฐํํด๋ผ. ๋๋ณด๊ธฐ https://leetcode.com/problems/running-sum-of-1d-array/ ๐ Solution ๐ค JavaScript /** * @param {number[]} nums * @return {number[]} */ var runningSum = ..
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. ์ ์ ๋ฐฐ์ด (nums) ๊ณผ ์ ์ (target) ๊ฐ ์ฃผ์ด์ง๋ฉด, ๋ ์ซ์์ ํฉ์ด target ์ด ๋๋๋ก ๋ฐฐ์ด์ ๋ฐํํ๋ค. ๊ฐ ์ ๋ ฅ์ ์ ํํ ํ๋์ ๋ฐฉ์์ด ์๋ค๊ณ ๊ฐ์ ํ ์ ์๊ณ , ๋์ผํ ์์๋ฅผ ๋ ๋ฒ ์ฌ์ฉํ ์ ์๋ค. ์ด๋ค ์์๋ก๋ ..