Skip to content

Instantly share code, notes, and snippets.

static class Vector2D {
public List<List<Integer>> data;
int row,col=-1;
int pRow = -1, pCol = -1;
public Vector2D(List<List<Integer>> v) {
data = v;
}
public void remove(){
public class IteratingList {
boolean isEmpty;
public ArrayList<ArrayList<Integer>> list;
private int listIdx, posIdx;
private int nextListIdx, nextPosIdx;
// last indicies are used to keep track of the last printed element
private int lastListIdx = -1, lastPosIdx = -1;
public IteratingList(ArrayList<ArrayList<Integer>> list){
public class Vector2D {
public int[][] data;
int row,col=-1;
int pRow = -1, pCol = -1;
public Vector2D(int[][] v) {
data = v;
}
public void remove(){