You are given an array, for example:
arr = [['AB','KR','EH'],['EE','DD','PS'],['GH','LM','XK']]
Then, through a function, you have to get this:
The array must be sorted ascending as a whole and not only by rows. You can not create new arrays for this. You have to do it in place.
I tried to find a way to do this with no new arrays but I could not. This is my code, it certainly sorts the array but creates a new array.
def sortArray(arr): #n : filas,columnas
sorted_arr = []
for j in arr:
sorted_arr.extend(j)
return sorted(sorted_arr)