Here you can find the source of maxset(ArrayList
public static ArrayList<Integer> maxset(ArrayList<Integer> a)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; public class Main { public static ArrayList<Integer> maxset(ArrayList<Integer> a) { ArrayList<Integer> list = new ArrayList<Integer>(); ArrayList<ArrayList<Integer>> holder = new ArrayList<ArrayList<Integer>>(); int maxSum = 0; int counter = 0; for (Integer element : a) { if (element >= 0) { } else { }/* ww w .ja va 2s . c o m*/ } return list; } }