Why my answer is wrong?


  • 0
    D

    class Solution {
    public:
    int removeElement(int A[], int n, int elem) {
    if (A==NULL)
    return 0;
    vector<int> temp;
    temp.assign(A,A+n);

        temp.erase(remove(temp.begin(), temp.end(), elem),temp.end());
        return temp.size();
        
    }
    

    };


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.