c++ partition and lambda(just 1 line)


  • 0
    int removeElement(vector<int>& a, int val) {
        return partition(a.begin(),a.end(),
    [&val](const int& i){return i-val;})-a.begin();
    }
    

Log in to reply
 

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