Add number range to output

This commit is contained in:
2020-06-11 12:17:33 -05:00
parent ba8820896e
commit 5a45b0ca3e
2 changed files with 11 additions and 1 deletions

View File

@@ -75,4 +75,14 @@ public class SortResult {
return nf.format(sortedArray.length);
}
public String getMin(){
NumberFormat nf = NumberFormat.getInstance(Locale.US);
return nf.format(sortedArray[0]);
}
public String getMax(){
NumberFormat nf = NumberFormat.getInstance(Locale.US);
return nf.format(sortedArray[sortedArray.length-1]);
}
}