I'm trying to swap elements in ArrayList<ArrayList<Integer>>. I wanted to know either an inbuilt function if present any or brute-force approach to solve :
swap(mat.get(i).get(j),mat.get(j).get(i+1))
swapping these 2 elements in a ArrayList<ArrayList<Integer>>.