1089. Duplicate Zeros
https://leetcode.com/problems/duplicate-zeros
Description
Given a fixed-length integer array arr
, duplicate each occurrence of zero, shifting the remaining elements to the right.
Note that elements beyond the length of the original array are not written. Do the above modifications to the input array in place and do not return anything.
Example 1:
Example 2:
Constraints:
1 <= arr.length <= 104
0 <= arr[i] <= 9
ac
Last updated