You are given an integer array nums.

Split nums into two arrays A and B using the following rule:

Return the absolute difference between the sums of the two arrays: |sum(A) - sum(B)|.

Note: An empty array has a sum of 0.

 

Example 1:

Input: nums = [2,3,4]

Output: 1

Explanation:

Example 2:

Input: nums = [-1,5,7,0]

Output: 3

Explanation:

 

Constraints: