The static function Math.min() returns the lowest-valued number passed into it, or NaN if any parameter isn't a number and can't be converted into one.
— MDN Web Docs
I put comments next to each line of code in the gist above to explain what is happening step by step.
Press enter or click to view image in full size
Conclusion
Thank you so much for stopping by! Stay tuned for more Algorithm Content. Java Style!