Question from the Kotlin test

Write a function that returns the maximum of two integers in Kotlin

Medium

Which of these are maximum valid functions?

Author: W3D TeamStatus: PublishedQuestion passed 591 times
Edit
2
Community Evaluations
developer avatar
Delightful Zebra
23/02/2022
La quatrième proposition serait plus idiomatique en sortant le `return` du `if` : `return if (a > b) a else b`
developer avatar
Auteur anonyme
24/02/2022
C'est vrai ! Merci pour ton retour. Pour l'instant je laisse comme cela mais si d'autres développeurs remontent la même chose je mettrai à jour la question.