MLE error on submission


It says “It does not matter what is left beyond the expected length.” in the problem statement. However, the solution expects that the modified vector should have a size equal to the expected length. Please fix this problem.


Yeah I’m having the same problem, even though I have solution as the editorial. Please fix it asap.


resize the array/vector before submitting!! it will work
i dont know why IB is such a pain!


You do not need to resize the array, but return the index of the position… see my example:

public int removeElement(ArrayList<Integer> a, int b) {
    int ptr = 0;
    for (int i = 0 ; i < a.size() ; i++) 
        if (a.get(i) != b) 

    return ptr;