What is the best (or anyway, really) of going through a bi-dimensional ArrayList<ArrayList<Integer>> and for every Int that is equal to 1 you leave it, otherwise you subtract 1 from it.
i.e. if arrayList.get(i).get(j) == 3 it will now be 2 and so forth, but if it is 1 it stays 1) Only in specific columns of the ARRAYLIST<ARRAYLIST<INTEGER>>.
What is the best (or anyway, really) of going through a bi-dimensional ArrayList<ArrayList<Integer>> and
Share
Get a shovel – there’s just one way to do it. Iterate over all the columns in all the rows:
If you’ve got an List of List it looks like this:
UPDATE:
Based on your edit, you should add an array or List of columns you want to perform this transformation on. I’ve added an example to the second snippet.