Java Generic 2D Linked List Problem
How to convert a 1D linked List into multiple linked lists with
sequential values together?
//Example 1: [1,1,2,3,3] becomes [[1,1],[2],[3,3]]
//Example 1: [1,1,2,1,1,2,2,2,2] becomes
[[1,1],[2],[1,1],[2,2,2,2]]
//Example 3: [1,2,3,4,5] becomes [[1],[2],[3],[4],[5]]
public <T> List<List<T>>
convert2D(List<T> list) {
// Given a 1D, need to combine sequential values together.
}