# Equal Sum Subarrays

Let's solve the Equal Sum Subrrays problem using Dynamic Programming.

## Statement

For a given array `nums`

, determine if the array can be divided into two subarrays such that the sum of both the subarrays is equal.

For example, we have an array

The total length of this array can be denoted as

$n$ that is$3$ .An array can only be divided into two equal subarrays if the total sum of the array is even. In this case, the total sum of array elements is

$1 + 2 + 3 = 6$ , so two equal sum subarrays can be obtained here, as$[1, 2]$ and$[3]$ , both having an equal sum of$3$ .In this case, TRUE will be returned as the array can be divided into two equal sum subarrays.

In case, the sum of array elements is odd or the array can not be divided into two equal sum subarrays, FALSE will be returned.

**Constraints:**

$1 \leq$ `nums.length`

$\leq 200$ $1 \leq$ `nums[i]`

$\leq 100$

## Examples

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.