Java two line solution


#1
        a.removeIf(t->t==b);
    return a.size();goes here.