|
1 | 1 | packagecom.fishercoder.solutions;
|
2 | 2 |
|
3 |
| -/** |
4 |
| - * 1089. Duplicate Zeros |
5 |
| - * |
6 |
| - * Given a fixed length array arr of integers, duplicate each occurrence of zero, shifting the remaining elements to the right. |
7 |
| - * |
8 |
| - * Note that elements beyond the length of the original array are not written. |
9 |
| - * |
10 |
| - * Do the above modifications to the input array in place, do not return anything from your function. |
11 |
| - * |
12 |
| - * Example 1: |
13 |
| - * Input: [1,0,2,3,0,4,5,0] |
14 |
| - * Output: null |
15 |
| - * Explanation: After calling your function, the input array is modified to: [1,0,0,2,3,0,0,4] |
16 |
| - * |
17 |
| - * Example 2: |
18 |
| - * Input: [1,2,3] |
19 |
| - * Output: null |
20 |
| - * Explanation: After calling your function, the input array is modified to: [1,2,3] |
21 |
| - * |
22 |
| - * Note: |
23 |
| - * |
24 |
| - * 1 <= arr.length <= 10000 |
25 |
| - * 0 <= arr[i] <= 9 |
26 |
| - * */ |
27 | 3 | publicclass_1089 {
|
28 | 4 | publicstaticclassSolution1 {
|
29 | 5 | publicvoidduplicateZeros(int[]arr) {
|
|