You already have a 2D-array inputArray. It is guaranteed that it has at least two nested arrays.
Create a new two-dimensional array with two nested arrays — the first and last arrays in inputArray — in reverse order. In other words, the last one should become the first, and vice versa.
Print the resulting array using the function contentDeepToString().
Tip: You can use first() and last().
Sample Input 1:
val inputArray = arrayOf(
arrayOf('P', 'R', 'O', 'G', 'R', 'A', 'M', 'M', 'I', 'N', 'G'),
arrayOf('I', 'S'),
arrayOf('M', 'A', 'G', 'I', 'C')
)
Sample Output 1:
[[M, A, G, I, C], [P, R, O, G, R, A, M, M, I, N, G]]
Sample Input 2:
val inputArray = arrayOf(
arrayOf(1, 2),
arrayOf(3, 4),
arrayOf(5, 6),
arrayOf(7, 8)
)
Sample Output 2:
[[7, 8], [1, 2]]