Apr 14, 2024
You don't care about this case, though.
You could also write this in one line as:
nums[:] = (i if i > 0 else n + 1 for i in nums)
You don't care about this case, though.
You could also write this in one line as:
nums[:] = (i if i > 0 else n + 1 for i in nums)