Given an array containing only positive integers, return if you can pick two integers from the array which cuts the array into three pieces such that the sum of elements in all pieces is equal.
Example 1:
Input: array = [1, 3, 4, 2, 2, 8, 1, 1, 1]
Output: true
Explanation: choosing the number 4 and 8 results in three pieces [1, 3], [2, 2] and [1, 1, 1]. Sum = 4.
Example 2:
Input: array =[1, 1, 1, 1],
Output: false
Copyright © A++ Code Bootcamp 2023