Question: Need Java Solution Consider an array containing at least 2 non-zero positive integers ranging between 1 and to 300. Divide the integers in inarr into
Consider an array containing at least 2 non-zero positive integers ranging between 1 and to 300. Divide the integers in inarr into two groups based on the following rules: Each of the integers should belong to either of the two groups Total sum of integers in each of the groups must be nearly as equal as possible Total number of integers between the 2 groups should not differ by more than 1 print , outnum1 and outnum2, the sum of integers of two groups separated by a space. If they are not equal, the print the smaller one first and the bigger one second Sample input: 87,100,28,67,68,41,67,1 Sample output: 229 230
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
