cpp code for transposing matrix without using new matrix
for(int i=0;i<arr.size();i++){ for(int j=0;j<i;j++){ swap(arr[i][j],arr[j][i]); } }