我根据逗号分隔的集合给出了界面..我需要实现..
我未能提出解决方案
import java.util.Collection;
/**
* Implement this Interface to produce a comma delimited list of numbers,
* grouping the numbers into a range when they are sequential.
*
*
* Sample Input: "1,2,6,7,8,9,12,13,14,15,21,22,23,24,25,31
* Result: "[[1],[2], [6,7,8], [13,14,15], [21-25], [32]]"
*
*/
public interface CommaDelimatedList {
public Collection<Integer> coll(String input);
public String summarizeColl(Collection<Integer> input);
}
有人可以帮我解决如何实现这个界面的问题..