|
@ -26,6 +26,19 @@ public class ArrayManipulation { |
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static int[] removeLast(int[] arr) { |
|
|
|
|
|
|
|
|
|
|
|
int[] result = new int[arr.length - 1]; |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < arr.length; i++) { |
|
|
|
|
|
|
|
|
|
|
|
if (i == arr.length){continue;} |
|
|
|
|
|
result[i - 1] = arr[i]; |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
public static void main(String[] args) { |
|
|
|
|
|
|
|
@ -36,5 +49,4 @@ public class ArrayManipulation { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
// hallo |
|
|
|
|
|
|
|
|
} |