Practice
Learn
← Quit
0 / 0 correct
Rust
Medium
1 of 10
What does Vec::retain do, and in what complexity?
A
Allocates a new Vec
B
Keeps elements matching a predicate, removing others in-place in O(n)
C
Sorts the vector
D
Removes the first matching element in O(1)