Medium Accuracy: 50.56% Submissions: 12486 Points: 4
You are given an array A of size N. Your task is to find the minimum number of operations needed to convert the given array to 'Palindromic Array'.
[23,15,23] is a ‘Palindromic Array’ but [2,0,1] is not.
The only allowed operation is that you can merge two adjacent elements in the array and replace them with their sum.
The first line of input contains an integer T denoting the number of test cases.The first line of each test case is N, where N is the size of array.The second line of each test case contains N space separated integers which is the input for the array.
Output the minimum number of operations required to make the given array a palindromic array.
1 <= T <= 100
1 <= N <= 100
1 <= A <= 100