How we get min and max value from the given values

What is the if condition required in for each loop

Please mention variable type of “Given Values”