Mislav likes palindromes. You are given an array A of N integers. The array is palindromic if A[i]=A[N−i+1] holds for every i, where the first element of the array has index 1.
In one move Mislav can pick two adjacent elements of the array and replace them with their sum. Each move decreases the number of elements by 1. For example, merging the first two elements of [1,2,3] gives [3,3].
Find the least number of moves needed to turn the original array into a palindromic one.