Make sums of left and right sides of array equal by removing subarray
问题 C program that finds starting and ending indexes of subarray to remove to make given array have equal sums of left and right side. If its impossible print -1. I need it to work for any array, this is just for testing. Heres a code that finds equilibrium. #include <stdio.h> int equilibrium(int arr[], int n) { int i, j; int leftsum, rightsum; /* Check for indexes one by one until an equilibrium index is found */ for (i = 0; i < n; ++i) { /* get left sum */ leftsum = 0; for (j = 0; j < i; j++)