Skip to content

Commit

Permalink
solution 03/11 21-26
Browse files Browse the repository at this point in the history
  • Loading branch information
VadimKadasiev committed Nov 3, 2023
1 parent 3d0ff6a commit 61ee063
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/core/basesyntax/ArrayList.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package core.basesyntax;


import java.util.NoSuchElementException;

public class ArrayList<T> implements List<T> {
Expand Down Expand Up @@ -99,7 +98,8 @@ public T remove(T element) {
}
if (arrayIndex !=0) {
Object[] newArray = new Object[arrayLength];
System.arraycopy(array, arrayIndex, newArray, arrayIndex-1, arraySize - arrayIndex);
System.arraycopy(array, arrayIndex, newArray, arrayIndex, arraySize);
System.arraycopy(array, arrayIndex+1, newArray, arrayIndex, arraySize - arrayIndex);
array = newArray;
arraySize--;
}
Expand Down

0 comments on commit 61ee063

Please sign in to comment.