Sort the integers array and set the index of smallest and largest element
Array . Sort ( integers ) ; int lowerIndex = 0 ; int higherIndex = integers . Length - 1 ; StringBuilder sb = new StringBuilder ( ) ;