What do you mean by "array"?
sort() function so if the array contains just simple numeric values you can just call this function and the smallest element will have index
0 and the largest element will have the index of
array size - 1
For more complex structures we need to see how does the array looks like as we're not telepathic enough to guess what do you have inside the array and what is the expected outcome.
Be aware that JMeter is a pure Java application hence you have access to full power of the JDK in case of more complex transformations/calculations are required