Hello I need help with one of my Google foobar questions this is what I've got so far.

```
package com.google.challenges;
import java.math.BigInteger;

public class Answer{

    public static String answer (int[] xs){
        BigInteger result = new BigInteger("1");
        int xsLen = xs.length, pos = 0;
        int[] negatives = new int[xsLen];
        if (xsLen == 1){
            return Integer.toString(xs[0]);
        }
        // Split the input up into pos/negative. Pos get put onto the final value, as they don't need anything else.
        // they are all useful. negative to onto seperate array and get sorted later
        for (int n = 0;n < xsLen;n++){
            int val = xs[n];
            if (val == 0){
                continue;
            }
            if (val > 0){
                result = result.multiply(new BigInteger(Integer.toString(val)));
            } else {
                negatives[pos] = val;
                pos++;
            }
        }
        // even number of negatives means a full product will always be positive.
        // odd number means that we discard the smallest number to maximise the result.
        if ((pos % 2) == 0){
            // even number, so add to result
            for (int i = 0;i < pos;i++){
                result = result.multiply(new BigInteger(Integer.toString(negatives[i])));
            }
        } else {
            // sort then discard the minimum
            int min = -1000; int mPos = -1;
            for (int i = 0;i < pos;i++){
                if(negatives[i] > min){
                    min = negatives[i];
                    mPos = i;
                }
            }
            for (int j = 0;j < pos;j++){
                if(j == mPos){
                    continue;
                }
                result = result.multiply(new BigInteger(Integer.toString(negatives[j])));
            }
        }

        // done, return the string;
        return result.toString();
    }
}

```

here's the question,

You need to figure out which sets of panels in any given array you can take offline to repair while still maintaining the maximum amount of power output per array, and to do THAT, you'll first need to figure out what the maximum output of each array actually is. Write a function answer(xs) that takes a list of integers representing the power output levels of each panel in an array, and returns the maximum product of some non-empty subset of those numbers. So for example, if an array contained panels with power output levels of [2, -3, 1, 0, -5], then the maximum product would be found by taking the subset: xs[0] = 2, xs[1] = -3, xs[4] = -5, giving the product 2\*(-3)\*(-5) = 30. So answer([2,-3,1,0,-5]) will be "30".

Each array of solar panels contains at least 1 and no more than 50 panels, and each panel will have a power output level whose absolute value is no greater than 1000 (some panels are malfunctioning so badly that they're draining energy, but you know a trick with the panels' wave stabilizer that lets you combine two negative-output panels to produce the positive output of the multiple of their power values). The final products may be very large, so give the answer as a string representation of the number.

Languages
=========

To provide a Python solution, edit solution.py
To provide a Java solution, edit solution.java

Test cases
==========

```
Inputs:
    (int list) xs = [2, 0, 2, 2, 0]
Output:
    (string) "8"

Inputs:
    (int list) xs = [-2, -3, 4, -5]
Output:
    (string) "60"

```

I've been at it for 2 days and would really like the answer so I can learn what I have done wrong and improve! Thanks for reading and hopefully you answer. :)