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.