+ 1
Anybody tell me the logic to find the mirror image of an array without using another array.
E.g. input 1 2 3 4 Output 2 1 3 4
1 Respuesta
0
1 is array[0][0], mir_arr[0][1]
2 is array[0][1], mir_arr[0][0]
as you can see, the row they are in is same as before, and the column are inversed. In other words, in an array n elements long, the k th colimn changes to the "(n-1)-k" th column in the original array.