2d iterator solution2 is buggy
mingjunz opened this issue · 0 comments
mingjunz commented
List<List> testcase = new ArrayList<>();
testcase.add(new ArrayList() {{
add(1);
add(2);
}});
testcase.add(new ArrayList() {{
add(3);
}});
testcase.add(new ArrayList() {{
add(4);
add(5);
add(6);
}});
TwoDIterator2 t = new TwoDIterator2(testcase);
t.next();
t.next();
t.hasNext();//this one move the colIt to next List's begin, but next move need to remove previous one, you need to bak up that one.
t.remove();