Thanks to visit codestin.com Credit goes to kotlinlang.org
Use maxByOrNull instead.
this.maxByOrNull(selector)
Thanks for your feedback!