|
@ -14,6 +14,18 @@ public class ArrayManipulation { |
|
|
return arr; |
|
|
return arr; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static int[] removeFirst(int[] arr) { |
|
|
|
|
|
|
|
|
|
|
|
int[] newArray1 = new int[arr.length -1]; |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 1; i < newArray1.length + 1; i++) { |
|
|
|
|
|
newArray[i - 1] = arr[i]; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return arr; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static int[] removeLast(int[] arr) { |
|
|
public static int[] removeLast(int[] arr) { |
|
|
|
|
|
|
|
|
int[] newArray = new int[arr.length - 1]; |
|
|
int[] newArray = new int[arr.length - 1]; |
|
|