Just think this problem as a DFS. What we need is to search for `3`

positions (i, j, k) and see if they divide the array to `4`

parts with same summary. Some tricks:

- Calculate
`left`

on the fly. Thus at last we don't need to calc summary of the`4th`

part. - Skip
`0`

during calculate`target`

because adding zero won't change it.

```
public class Solution {
public boolean splitArray(int[] nums) {
int sum = 0, target = 0;
for (int num : nums) sum += num;
for (int i = 1; i + 5 < nums.length; i++) {
if (i != 1 && nums[i - 1] == 0 && nums[i] == 0) continue;
target += nums[i - 1];
if (dfs(nums, i + 1, target, sum - target - nums[i], 1)) return true;
}
return false;
}
private boolean dfs(int[] nums, int start, int target, int left, int depth) {
if (depth == 3) {
if (left == target) return true;
return false;
}
int sub = 0;
for (int j = start + 1; j + 5 - depth * 2 < nums.length; j++) {
sub += nums[j - 1];
if (sub == target) {
if (dfs(nums, j + 1, target, left - sub - nums[j], depth + 1)) {
return true;
}
}
}
return false;
}
}
```