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