This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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(){ | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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){ | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public class Vector2D { | |
| public int[][] data; | |
| int row,col=-1; | |
| int pRow = -1, pCol = -1; | |
| public Vector2D(int[][] v) { | |
| data = v; | |
| } | |
| public void remove(){ |