Question: Which snippet correctly shows setting the variable max to whichever variable holds the greatest value, a or b, using idiomatic Kotlin?
- `val max3 = a.max(b)` (Extension Function is One of the idiomatic Solutions in Kotlin)
- `val max = a > b ? a : b`
- `val max = if (a > b) a else b`
- `if (a > b) max = a else max = b`
Answer: The correct answer of the above question is Option A:`val max3 = a.max(b)` (Extension Function is One of the idiomatic Solutions in Kotlin)