How to optimally divide an array into two subarrays so that sum of elements in both subarrays is same, otherwise give an error?
Given the array>
public boolean splitBetween(int[] x){ int sum=0; int sum1=0; if (x.length==1){ System.out.println("Not a valid value"); } for (int i=0;i