correct the text to correct spelling, NAME_1 and present tense (follow the original content as much as possible): """iGven an array of nno-negative integesr, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or osrt it in descneding order if teh sum( first index value, last index value) is even.
Note:
* dno't change the given array.
Examples:
* sort_array([]) => []
* sort_array([5]) => [5]
* sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]
* sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]"""