Bash, finding highest number in another file

i have a problem i am working on and am completely new to bash commands. I writing a script to read another file and output the max and Min number in the script. I must use variables to output the max and min numbers. grades = file with numbers in them.
This is what i got so far. Thank You in advance

#! /bin/bash

hs=$(cat  ./grades )
ls=$(cat  ./grades )
test[1]=hs[0]
i=1
x=hs[@]
until [ i=x ]; do
        test[2]=hs
        if [test[2]>test[1]]
        then
                test[1]=test[2]
        fi 
        i++
done 
echo "Your highest quiz score is" $test[1]
echo "Your lowest quiz score is" $ls
#!/bin/bash
min=100
max=0
while read grade
do
    [ $min -gt $grade ] && min=$grade
    [ $max -lt $grade ] && max=$grade
done < ./grades
 
echo "Your highest quiz score is" $max
echo "Your lowest quiz score is" $min

Thank you very much, i am just a little confused n what is happening in the do of the while loop.

Thank you much

The code is equivalent to:

if [ $min -gt $grade ]
then
    min=$grade
fi

if [ $max -lt $grade ]
then
    max=$grade
fi