title: Is this algorithm using DP?
body: <p>So I have been learning Dynamic Programming (DP) recently and when I came upon the following problem, I decided to use DP but since I'm a beginner in algorithms, I am not sure if this is a valid example of DP or not.</p>
  <p><strong>Problem:</strong></p>
  <blockquote>
  <p><em>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.</em></p>
  </blockquote>
  <pre><code>Example 1:
  
  Input: nums = [1,2,3,4]
  Output: [1,3,6,10]
  Explanation: Running sum is obtained as follows: [1, 1+2, 1+2+3, 1+2+3+4].
  </code></pre>
  <p>This is my &quot;DP&quot; solution:</p>
  <pre><code>class Solution {
      public int[] runningSum(int[] nums) {
          int[] arr = new int[nums.length];
          
          int sum = 0;
          
          for(int i = 0; i &lt; nums.length; i++){
              arr[i] = nums[i] + sum;
              sum += nums[i];
          }
          
          return arr;
      }
  }
  </code></pre>