Browse Source

removeLast hinzugefügt

secondBranch
Anna Schiedner 2 years ago
parent
commit
1a3bdda827
  1. 7
      ArrayManipulation.java

7
ArrayManipulation.java

@ -26,4 +26,11 @@ public class ArrayManipulation {
}
return newArray;
}
public static int[] removeLast(int[] arr) {
int[] result = new int[arr.length-1];
for (int i = 0; i < arr.length-1; i++) {
result[i] = arr[i];
}
return result;
}
}