Given an array, you can do a merge operation where you merge (or sum) two adjacent equal numbers, remove both the numbers, and replace with the new merged number. For example, [3 1 1] becomes [3 2]. Now you can operate infinite number of times, and you need to return the smallest final array after doing all the possible operations optimally, e.g. for [1 1 1 1] the answer will be [4] and not [1 2 1].