79425881

Date: 2025-02-10 00:04:31
Score: 1
Natty:
Report link

An alternative is to use the Elvis operator ?: like this:

val max = maxOf(value ?: INT.MIN_VALUE, nums[i])

or, if your numbers are all positive:

val max = maxOf(value ?: 0, nums[i])

There are times you really want an array of nulls due to space constraints.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Janin