src/main/java/com/mobiquityinc/packer/Packer.java
protected static String processPackage(int capacity, List<Thing> things) {
        List<Integer> items = solveUnboundedKnapsackProblem(capacity, things);
        if (items.isEmpty()) {
            return "-";
        }
        Collections.sort(items);
        return items.stream().map(String::valueOf).collect(Collectors.joining(","));
    }
/**
     * Determines set of things that you put into the package and sort them.
     * @param capacity weight limit of package.
     * @param things the list of all things for the package.
     * @return the sorted set of things' indexes need to be chosen,
     * or symbol '-' if package is empty.
     */
Determines set of things that you put into the package and sort them.
@param capacity weight limit of package.
@param things the list of all things for the package.
@return the sorted set of things' indexes need to be chosen,
or symbol '-' if package is empty.
Determines set of things that you put into the package and sort them . @param capacity weight limit of package . @param things the list of all things for the package . @return the sorted set of things ' indexes need to be chosen or symbol ' - ' if package is empty .
protected static String processPackage(int capacity, List<Thing> things) {
        List<Integer> items = solveUnboundedKnapsackProblem(capacity, things);
        if (items.isEmpty()) {
            return "-";
        }
        Collections.sort(items);
        return items.stream().map(String::valueOf).collect(Collectors.joining(","));
    }
protected static String processPackage ( int capacity , List < Thing > things ) { List < Integer > items = solveUnboundedKnapsackProblem ( capacity , things ) ; if ( items . isEmpty ( ) ) { return "-" ; } Collections . sort ( items ) ; return items . stream ( ) . map ( String :: valueOf ) . collect ( Collectors . joining ( "," ) ) ; }
Determines set of things that you put into the package and sort them.
Determines set of things that you put into the package and sort them .